0

I'm using Linux and I'm trying to tramp into a Windows machine. I'm trying to set the remote-shell option of tramp because tramp's default of /bin/sh doesn't work for a Windows remote host. I'd like to set tramps remote shell to:

C:\Program Files\Git\bin\sh.exe

I've tried to add this to /home/username/.emacs:

(require 'tramp)
(add-to-list 'tramp-connection-properties
    (list (regexp-quote "/sshx:myusername@mywindowshost:")
        "remote-shell" "C:\Program Files\Git\bin\sh.exe"))

I've also tried every way I could find or imagine to escape this space in the middle, and the slashes also. In the end that path is never understood.

I don't know anything about Emacs Lisp. I thought it would escape slashes like most other languages.

I can change the default shell of OpenSSH on Windows. I've set it to use cmd, powershell, or "C:\Program Files\Git\bin\sh.exe". They all work for connecting via ssh. Unfortunately tramp insists on using /bin/sh instead of the default. And no matter the OpenSSH shell set, the string with the space in the middle of "Program Files" is never understood like intended.

4
  • 1
    It looks like you've asked 3 questions that are very similar, if not perhaps even the same. You show the same code in each. If you are evolving a single question, please don't do that by adding additional questions. Just edit an existing question. If you've created what are essentially duplicates then please delete all that are dups. Thx.
    – Drew
    Commented May 22, 2023 at 2:07
  • The first question was about what file to edit to affect the configuration of tramp: the question can be useful to people whatever they're trying to do with tramp. Hence I put it in its own topic. This question is about specifying a remote shell that contains a space. This is a very different and narrow question that is about tramp and possibly the way strings work with elisp. The other question asks if it's possible to use a language server for eglot on a remote machine. There might be limitation to how eglot can be used and I inquired about that. Commented May 22, 2023 at 15:31
  • Putting each of these very different questions in their own respective threads makes it easier for users in the future that will encounter, probably one, but probably not 3 of the interrogations combined, to find the solution they're looking for. Commented May 22, 2023 at 15:33
  • 1
    Yes, separate posts is the right thing for different questions. (I wasn't sure how different they were. Sorry for the noise.
    – Drew
    Commented May 22, 2023 at 21:25

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.