Skip to content

[cherry-pick] [WindowsSandboxing]: Updated env and commandline for executing commands using pwsh.exe (#318466)#318476

Merged
dileepyavan merged 1 commit into
release/1.122from
cherry-pick/318466
May 27, 2026
Merged

[cherry-pick] [WindowsSandboxing]: Updated env and commandline for executing commands using pwsh.exe (#318466)#318476
dileepyavan merged 1 commit into
release/1.122from
cherry-pick/318466

Conversation

@dileepyavan
Copy link
Copy Markdown
Member

Cherry-pick of #318466 to release/1.122.

This backports the Windows MXC PowerShell command-line/environment changes and related package and test updates.

Validation:

  • npm run transpile-client
  • src/vs/platform/sandbox/test/common/terminalSandboxEngine.test.ts
  • src/vs/workbench/contrib/terminalContrib/chatAgentTools/test/browser/terminalSandboxService.test.ts

Focused test result: 75 passed, 0 failed.

…ecuting commands using pwsh.exe (#318466)

(cherry picked from commit 5fd81ae)
Copilot AI review requested due to automatic review settings May 27, 2026 00:46
@dileepyavan dileepyavan enabled auto-merge (squash) May 27, 2026 00:46
@vs-code-engineering
Copy link
Copy Markdown
Contributor

📬 CODENOTIFY

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

@anthonykim1

Matched files:

  • src/vs/workbench/contrib/terminalContrib/chatAgentTools/test/browser/terminalSandboxService.test.ts

Copy link
Copy Markdown
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

Cherry-pick of #318466 to release/1.122. Updates Windows MXC sandboxing to launch user commands via pwsh.exe with explicit arguments, expands the injected Windows/PowerShell environment, switches containment to processcontainer, defaults Windows cwd to the first write root, resolves Windows filesystem symlinks, and bumps @microsoft/mxc-sdk to 0.2.1. Tests are updated to cover the new command line, env vars, cwd fallback, and symlink resolution.

Changes:

  • MXC config now wraps the command with "<shell>" -NoProfile -ExecutionPolicy Bypass -Command "<cmd>", uses containment: 'processcontainer', sets ui.allowWindows: true, and adds the shell's directory to readonly paths.
  • SandboxHelperService.getWindowsMxcEnvironment now exports SystemRoot, PATH, ComSpec, PATHEXT, PSModulePath, USERPROFILE, APPDATA, LOCALAPPDATA, PSHOME; Windows paths are resolved through realpath via a new _toWindowsFileSystemResource converter.
  • Bumped @microsoft/mxc-sdk from 0.2.0 to 0.2.1 in both root and remote manifests/lockfiles.
Show a summary per file
File Description
src/vs/platform/sandbox/common/terminalSandboxMxcRuntime.ts Build PowerShell-wrapped command line, switch containment to processcontainer, add shell dir to readonly, set allowWindows.
src/vs/platform/sandbox/common/terminalSandboxEngine.ts Pass shell to MXC config, default Windows cwd to first write root, resolve Windows paths via new URI converter.
src/vs/platform/sandbox/node/sandboxHelper.ts Inject expanded Windows/PowerShell env vars into MXC environment.
src/vs/platform/sandbox/test/common/terminalSandboxEngine.test.ts Update Windows fixtures/assertions; add symlink-resolution test.
src/vs/workbench/contrib/terminalContrib/chatAgentTools/test/browser/terminalSandboxService.test.ts Update remote Windows test for new env, command-line wrapping, and shell dir read access.
package.json, package-lock.json, remote/package.json, remote/package-lock.json Bump @microsoft/mxc-sdk to 0.2.1.

Copilot's findings

Files not reviewed (1)
  • remote/package-lock.json: Language not supported
  • Files reviewed: 7/9 changed files
  • Comments generated: 0

@dileepyavan dileepyavan merged commit a7c4968 into release/1.122 May 27, 2026
26 checks passed
@dileepyavan dileepyavan deleted the cherry-pick/318466 branch May 27, 2026 01:17
@vs-code-engineering vs-code-engineering Bot added this to the 1.122.0 milestone May 27, 2026
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.

3 participants