Skip to content

Conversation

@dmitrivMS
Copy link
Contributor

Fixes #239139

Copilot AI review requested due to automatic review settings January 12, 2026 08:30
@dmitrivMS dmitrivMS added the portable-mode VS Code portable mode issues label Jan 12, 2026
@dmitrivMS dmitrivMS self-assigned this Jan 12, 2026
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 prevents VS Code from making OS-level state changes when running in portable mode, ensuring the application leaves no traces on the host machine.

Changes:

  • Added isPortable property to IEnvironmentMainService that checks the VSCODE_PORTABLE environment variable
  • Updated workspacesHistoryMainService.ts to skip OS-level recent document tracking on Windows and macOS when in portable mode
  • Updated electronUrlListener.ts to skip protocol handler registration on Windows when in portable mode

Reviewed changes

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

File Description
src/vs/platform/environment/electron-main/environmentMainService.ts Adds isPortable getter to expose portable mode status via environment variable check
src/vs/platform/workspaces/electron-main/workspacesHistoryMainService.ts Guards all OS state-changing operations (recent documents, jump lists, dock updates) with portable mode checks
src/vs/platform/url/electron-main/electronUrlListener.ts Prevents Windows protocol handler registration in portable mode to avoid OAuth flow issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

portable-mode VS Code portable mode issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Do not register a protocol handler in portable mode

2 participants