fix: combine URI flags to prevent Electron argument filtering on Windows#308150
Open
maruthang wants to merge 1 commit intomicrosoft:mainfrom
Open
fix: combine URI flags to prevent Electron argument filtering on Windows#308150maruthang wants to merge 1 commit intomicrosoft:mainfrom
maruthang wants to merge 1 commit intomicrosoft:mainfrom
Conversation
On Windows, Electron/Chromium's security layer filters out standalone command-line arguments that look like URLs (containing "://"). This causes --folder-uri and --file-uri to fail silently when the URI value is not the last argument. Combine --folder-uri and --file-uri with their values using "=" syntax before spawning the Electron process, so Chromium treats them as flags rather than standalone URL arguments. Fixes microsoft#209072
Contributor
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: @bpaseroMatched files:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #209072
Summary
://(treated as URLs). This causes--folder-uriand--file-urito fail silently when the URI value is not the last argument.cli.ts, combine--folder-uriand--file-uriflags with their values using=syntax (e.g.,--folder-uri=vscode-remote://...), so Chromium treats them as--prefixed flags rather than standalone URL arguments.Test plan
code --folder-uri vscode-remote://ssh-remote+host@workspace --new-window— should open the remote workspacecode --folder-uri vscode-remote://ssh-remote+host@workspace --wait --new-window— should open and waitcode --file-uri vscode-remote://ssh-remote+host@/path/file.txt --new-window— should open the remote file--folder-uristill works as the last argument (existing behavior preserved)