1

Tramp is very tenacious in overriding the PATH setting of a remote machine. How can I completely disable this, so that Tramp's PATH is identical to what I get when I manually log in with ssh on the terminal?

The ~/.bashrc in my remote machine looks as follows:

export PATH1=$PATH
# activate some Python virtualenvs, etc...
export PATH2=$PATH

I want the final PATH to be PATH2. The closest I can get to that is when setting tramp-remote-path to the value '(tramp-own-remote-path), in which case my PATH ends up being identical to PATH1. (I'm checking this by doing M-x compile RET env RET while editing a remote file.)

One interesting solution (with other applications as well) would be to stipulate, as a directory or connection-local variable, an additional rc file on the remote machine that is sourced every time Tramp connects. Is this possible at all?

1

Short solution: add all PATH-related settings to ~/.profile instead of ~/.bashrc, and make sure the former is sh-compatible.

0

Interesting idea. I have added it to the TODO list of Tramp. If you want to discuss further, I invite you to the <tramp-devel@gnu.org> mailing list. SX is not intended for longer discussions.

1
  • Do you consider this just a bug, or would you like more details about my motivation here? In the latter case, I'd be happy to discuss it on the mailing list. – Augusto Dec 19 '20 at 18:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.