microsoft / microsoft/vscode-remote-release
Run separate VS Code servers per workspace in the same remote to enable different env variables per workspace.
Nobody has claimed this yet.
- Dominant language
- Dockerfile
- Stars
- 4.2k
- Forks
- 470
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 1
Description
VSCode Version: 1.63.2
SSH Remote extension latest preview (v0.71.2021121615 Pre-Release)
Local OS Version: Fedora 35
Remote OS Version: CentOS 7.9
Remote Extension/Connection Type: SSH
Consider the following ssh config for 2 different environment on 1 remote node (simple example, my actual one has way more variables for tool path setups etc.):
Host slpcomp1-project1
HostName slpcomp1
User mkrause
ForwardX11 yes
RemoteCommand bash -c "export PRJHOME=/lscratch/mkrause/project1; bash"
Host slpcomp1-project2
HostName slpcomp1
User mkrause
ForwardX11 yes
RemoteCommand bash -c "export PRJHOME=/lscratch/mkrause/project2; bash"
Now connect to these projects:
For project1 everything looks as expected:

For project2 we end up with the wrong environment:

This is of course an error, because our remote command did not actually get honored. VS Code just reused the existing connection, which in this case is obviously incorrect.
When looking at the process tree it actually looks kind of hilarious because the session we wanted is there (green arrow), but the whole second editor window and the embedded terminal ended up under the process tree of the first window, which is entirely unrelated.

So for actual different workspaces there needs to be a seperate vs code server running, otherwise you cannot work in two different environments and workspaces on the same node, which an absolute must in more complex tool and environment setups.
/cc @mhoeher
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the SSH setup with two aliases targeting the same remote host but different RemoteCommand environment variables. Inspect how the remote extension identifies and reuses connections, using the reported process tree as a reference. Done means separate workspaces can retain their distinct environments instead of sharing the first server.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- vscode
- Domain
- devtools
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100