Skip to content

Conversation

@doggy8088
Copy link
Contributor

Fixes #51

The double quote is unnecessary for spawn on Windows.

@doggy8088 doggy8088 requested a review from a team as a code owner January 20, 2026 09:55
Copilot AI review requested due to automatic review settings January 20, 2026 09:55
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 fixes an escape issue in the Windows-specific code path for spawning CLI processes. The double quotes around the CLI path were causing issues when using cmd /c to execute non-absolute paths on Windows.

Changes:

  • Removed unnecessary double quotes from the CLI path argument when using cmd /c on Windows

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 724 to 730
} else if (process.platform === "win32" && !isAbsolutePath) {
// On Windows, spawn doesn't search PATHEXT, so use cmd /c to resolve the executable.
command = "cmd";
spawnArgs = ["/c", `"${this.options.cliPath}"`, ...args];
spawnArgs = ["/c", `${this.options.cliPath}`, ...args];
} else {
command = this.options.cliPath;
spawnArgs = args;
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

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

The Windows-specific spawn behavior lacks test coverage. Consider adding a test case that verifies the spawn arguments are correctly constructed for non-absolute paths on Windows, especially since this code path is platform-specific and was previously broken.

Copilot uses AI. Check for mistakes.
Copy link
Contributor

@SteveSandersonMS SteveSandersonMS left a comment

Choose a reason for hiding this comment

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

Thanks @doggy8088!

@SteveSandersonMS SteveSandersonMS added this pull request to the merge queue Jan 20, 2026
Merged via the queue into github:main with commit 51f1933 Jan 20, 2026
5 of 18 checks passed
@doggy8088 doggy8088 deleted the patch-1 branch January 20, 2026 13:54
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.

'\"copilot\"' is not recognized as an internal or external command, operable program or batch file.

2 participants