Skip to content

Include remote debug extension host env in remote terminal shell env#299007

Open
eliericha wants to merge 3 commits intomicrosoft:mainfrom
eliericha:richa/shell-env
Open

Include remote debug extension host env in remote terminal shell env#299007
eliericha wants to merge 3 commits intomicrosoft:mainfrom
eliericha:richa/shell-env

Conversation

@eliericha
Copy link
Contributor

This fixes #241078.

The environment specified in a launch.json env or envFile property is passed to the extension host and ultimately into environmentService.debugExtensionHost.env.

In the case of the browser service there was a missing parsing of the extensionEnvironment parameter in the payload.

Then createProcess includes this environment into the call arguments to inject it into spawned terminals.

Copilot AI review requested due to automatic review settings March 3, 2026 17:03
@vs-code-engineering
Copy link

vs-code-engineering bot commented Mar 3, 2026

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

@bpasero

Matched files:

  • src/vs/workbench/services/environment/browser/environmentService.ts

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses #241078 by ensuring environment variables provided via an extension host debug launch.json (env/envFile) are properly propagated in remote scenarios so that spawned remote terminals (and therefore vscode.ShellExecution-backed tasks) inherit them.

Changes:

  • Parse the extensionEnvironment payload parameter in the browser workbench environment service to populate debugExtensionHost.env.
  • Include debugExtensionHost.env when constructing resolverEnv for remote terminal process creation.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/vs/workbench/services/environment/browser/environmentService.ts Adds parsing of extensionEnvironment payload into debugExtensionHost params.
src/vs/workbench/contrib/terminal/common/remote/remoteTerminalChannel.ts Merges debugExtensionHost.env into the remote resolver environment passed to the pty host create-process request.

eliericha and others added 2 commits March 3, 2026 18:14
…ce.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…Channel.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

4 participants