Paul
Paul

Reputation: 33

How do I add something to my PATH on the server side when using VSCode Remote SSH?

I'm using Visual Studio Code's Remote SSH extension to develop code on my university's linux cluster, which still has an older version of git installed (1.8.3.1). This causes errors with the "GitLens" extension that I'm also using.

I tried solving this problem by just cloning my own version of git into "~/git" and compiling it there for myself. Then I added

export PATH=$HOME/git:$PATH

to my .zshrc file.

The problem is that vscode doesn't seem to care what I put in the .zshrc file. Is there another way to set a custom git executable on the server side?

I also tried doing the same in the ".bashrc" file, just in case vscode uses bash for some reason. This also didn't work.

Upvotes: 2

Views: 518

Answers (1)

phd
phd

Reputation: 94520

The commands at the remote end of an SSH tunnel are executed using non-interactive shell so I think ~/.zshrc is not executed. Use ~/.zshenv or ~/.zprofile. See http://zsh.sourceforge.net/Doc/Release/Files.html.

Upvotes: 1

Related Questions