On Sat, Apr 10, 2021 at 6:20 AM Michael Albinus <[email protected]> wrote: > > Jim Porter <[email protected]> writes: [snip] > > Perhaps Tramp can reply with the appropriate ANSI escape in this case > > to make things work. Or perhaps not. I haven't had a chance to dig > > into this very deeply, but when I get the time, I'll try to collect > > some logs and narrow down the problem so I can send the results to the > > list. > > Accessing an ssh server on MS Windows via Tramp will fail in general, > because Tramp expects a POSIX shell on the server side. If I read the > docs correctly, the ssh server on MS Windows opens a powershell.
You can actually set the default ssh shell on MS Windows to be a POSIX shell by setting a registry value[1]. I've tried this and it works well when using PuTTY or ssh via the command line, though the ANSI escapes are still there, and I haven't been able to get it to work through Tramp yet. The ubiquity of Git has a nice side effect here: every MS Windows system with Git installed has sh.exe and dozens of other common POSIX programs in .../Git/usr/bin. In theory, Tramp (or the user) just needs to change the `tramp-remote-shell' property from "/bin/sh" to "C:/Program Files/Git/usr/bin/sh.exe"[2] when connecting to an MS Windows server. If the ANSI escape issue is resolved, setting `tramp-remote-shell' might be enough to allow connecting to MS Windows servers via sshx. I'm still not 100% sure the ANSI escapes are the problem, but if so, this would hopefully reduce the amount of effort required to make this work. - Jim [1] https://docs.microsoft.com/en-us/windows-server/administration/openssh/openssh_server_configuration#configuring-the-default-shell-for-openssh-in-windows [2] Or wherever Git is installed on the server
