Skip to content

Document how to run code instances with separate environment variables #8967

@ayeltsov

Description

@ayeltsov

By default, VS Code instance environment variables are used from:

  • if this is first Code instance, from parent process.
  • if this is not first Code instance, from already running Code instance.

In my case this nondeterministic behavior breaks build in 2nd instance.

Problem: variable behavior is difficult to discover (might be hard to solve this) and, once discovered, difficult to understand how to "fix" (this is the complaint).

Searching in the issues, I at first thought that either --new-window or --preserve-env or combination of both would fix it, but that didn't work.
Further searching and trial and error lead to one workaround - setting unique `--user-data-dir' seems to do the trick, however I don't think it's documented to do so.

Asks:

  1. Document simplest way of isolating code instances
  2. Ideally, if is there a default that I could set so that code instances are isolated based on what folder they are launched for, I'd love that.

Version info:

Version: 1.105.0 (user setup)
Commit: 03c265b1adee71ac88f833e065f7bb956b60550a
Date: 2025-10-08T14:09:35.891Z (2 days ago)
Electron: 37.6.0
ElectronBuildId: 12502201
Chromium: 138.0.7204.251
Node.js: 22.19.0
V8: 13.8.258.32-electron.0
OS: Windows_NT x64 10.0.26200

Metadata

Metadata

Assignees

Labels

doc-enhancementsuggested addition or improvement

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions