reddit / emacs

Help getting vterm to work over tramp

XtremePocket · 2022-05-19 19:11
I have a line in my `.bashrc` to add nvim to the path and also one that adds the rust package (`~/.cargo/bin`) binaries. But even if I remove these two lines from the `.bashrc`, when the vterm is ready, the path still mysteriously contains these two (after restarting emacs). Is there a way to check which files tramp mode loaded? Perhaps tramp loaded an out-of-date rc file somewhere that I couldn't find?
XtremePocket · 2022-05-19 19:34
More context to this question: I'm trying to get vterm+tramp working on my HPC server. The server has some default paths added when logging in through a normal shell. Vterm or tramp doesn't really get these for some reason, I was naturally looking for a way to add these default path to my emacs. But it turns out that none of the `.profile`, `.bash_profile`, `.bashrc` are called.
XtremePocket · 2022-05-19 20:28
Ok so I finally found the file! I can't believe I missed this, but it turns out tramp defaulted to using zsh instead of bash. I didn't find a way to change the default shell, so I just symlinked the bashrc to zshrc. But weirdly some binaries are still missing. One example is \`shopt\`: If I log in using a normal shell it's available, but calling \`which shopt\` will tell me it doesn't exist on the path. My server clearly does something before loading the profile files. I believe all of these trouble arises from the fact that we only create a children from an existing terminal from tramp, which sets a default path and thus it won't be treated as a new login, and thus misses the server's shenanigans, having only access to those commands available in the path. Is there a way to work around this? For example, creating a brand new terminal (a new login) when vterm is invoked?
paretoOptimalDev · 2022-05-19 21:49
(add-to-list 'tramp-remote-path 'tramp-own-remote-path) Good explanation: https://stackoverflow.com/questions/26630640/tramp-ignores-tramp-remote-path#26649558