Repository navigation
Open the CLI login URL on Windows without cmd start - #1524
Merged
Merged
Conversation
helpcodeai
enabled auto-merge (squash)
November 5, 2026 08:18
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Summary
amcp loginon Windows opened the browser withcmd /c start "" <url>. cmd reads the URL as a command line, so it stopped at the first&of the login URL (callback=…&state=…&scope=…) and tried to run the rest as commands. The browser got a URL withoutstate, so login failed, and the rest of the URL went to cmd. Code scanning alert #658 found it.Changes
rundll32 url.dll,FileProtocolHandler <url>. The URL is passed as a single argument, and no shell parses it.browserCommand(platform, url), so it can be tested on every OS.Type
Testing
packages/cli:npm testpasses 22, skips 2 (fish is not installed), fails 0. The new test checks that a URL containing&reaches Windows unchanged as one argument.Checklist
npm test, CLI package)Related Issues
Fixes code scanning alert #658.
Deployment: CLI only. Nothing changes on Cloud or self-hosted servers.