microsoft / microsoft/vscode-remote-release

"terminal.integrated.env.linux" parsing improvements

Open
#11,378 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Dockerfile
Stars
4.2k
Forks
469
Avg merge
1d 1h
Merged PRs (30d)
1

Description

Hello!

I regularly use "terminal.integrated.env.linux" to set additional paths, but using it inside a remote WSL is quite limited at the momment:

  1. Setting PATH with "terminal.integrated.env.linux" overrides the /bin/remote-cli that was prepended breaking some integrations
  2. Vscode settings variables are not expanded as expected https://github.com/microsoft/vscode-remote-release/issues/35#issuecomment-490022164. So it's not possible to use ${workspaceRoot}/bin like in a native install, but ${env:PATH} works (it's missing .../bin/remote-cli as mentioned)
  3. WSL config fails to load windows PATH Spaces in windows PATH break when appendWindowsPath is true
    • This seems to be on WSL, but worth mentioning as it's affecting PATH too
    • Btw I guess it would never load "terminal.integrated.env.windows" but it would be interesting as an option
# no setting: base path, notice bin/remote-cli
diegomateos@LTMITS180:~$ $PATH
bash: /home/diegomateos/.vscode-server/bin/ac4cbdf48759c7d8c3eb91ffe6bb04316e263c57/bin/remote-cli:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib:/snap/bin: No such file or directory

# setting: "terminal.integrated.env.linux": { "PATH": "${env:PATH}:${workspaceRoot}/bin", },
# WARN: lost bin/remote-cli, ${env:PATH} expanded but ${workspaceRoot} nope
diegomateos@LTMITS180:~$ $PATH
bash: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib:${workspaceRoot}/bin:/snap/bin: No such file or directory

TBH I actually use local nested settings inside the config which is not very documented but works quite well.
The expansion seems related to vscode vars like ${workspaceRoot}, so hopefully these would work too.

// minimal example of local nested vars (names are arbitrary): you can reuse / merge them and can be used in launch/tasks too
"env": {
     "tools":"${workspaceRoot}/_tools",
     "lin": {
          "path" : "${config:env.tools}:${env:PATH},
      }
}
"terminal.integrated.env.linux": { "PATH": "${config:env.lin.path}", },

Thanks, best regards!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No repository files, tests, or implementation entry points are named. Start by reproducing the terminal.integrated.env.linux cases in a remote WSL workspace, then trace how PATH and VS Code variables are expanded; done means the requested PATH preservation and variable parsing behavior is defined and covered for the reported scenarios.

Written by the indexing model from the issue text.

Assessment

Tech stack
linux, vscode
Domain
cli, developer-experience, operating-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.