Skip to content

VS Code always uses getUnixShellEnvironment if the first launch is from the GUI #55144

@segevfiner

Description

@segevfiner
  • VSCode Version: 1.25.1
  • OS Version: Ubuntu 16.04.5 x86_64 (This is Linux and macOS only)

Steps to Reproduce:

  1. Open VS Code from the GUI (.desktop shortcut) (VSCODE_CLI will be unset)
  2. Open a separate terminal window and change your PATH, for example: Enter a virtualenv.
  3. Launch VS Code from that terminal: code ..
  4. Open the developer tools and check process.env. Your PATH will be reset to your shell's default.

The cause is that this code: https://github.com/Microsoft/vscode/blob/d983257e6f8db693962d0dba9a025678f50778fe/src/vs/code/node/shellEnv.ts#L83-L92

Is executed in the VS Code main process that gets it's environment variables from the first launch of VS Code instead of checking if the new environment that was received for this launch request is from the GUI or CLI.

Does this issue occur when all extensions are disabled?: Yes

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable buginsiders-releasedPatch has been released in VS Code InsiderslinuxIssues with VS Code on LinuxmacosIssues with VS Code on MAC/OS XverifiedVerification succeededworkbench-cliVS Code Command line issues

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions