Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Environment from extensionHost debug configuration is not inherited by vscode.ShellExecution tasks #241078

Open
eliericha opened this issue Feb 18, 2025 · 0 comments
Assignees
Labels
terminal-process Problems launching processes, managing ptys, exiting, process leaks, etc.

Comments

@eliericha
Copy link

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

  • VS Code Version: 1.97.2
  • OS Version: macOS 14.6.1

Steps to Reproduce:

  1. Define an extensionHost debug configuration with environment variables specified in env or envFile.
  2. Write code in the extension or tests that spawns a vscode.ShellExecution task that makes use of the above environment variables.
  3. Observe that the spawned task does not inherit the environment variables from the debug configuration, contrary to the documentation of vscode.ShellExecutionOptions which states that by default the parent process environment is inherited.

I created a self-contained workspace with the above steps already prepared. All you have to do is to run the Run Extension Tests debug configuration defined in launch.json to observe the problem.

I suspect that the issue is that the vscode.ShellExecution implementation caches process.env too early, before the environment variables of the debug configuration were applied.

I hope this helps.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
terminal-process Problems launching processes, managing ptys, exiting, process leaks, etc.
Projects
None yet
Development

No branches or pull requests

4 participants