-
Notifications
You must be signed in to change notification settings - Fork 3.3k
fix(setup): quote repo path in --spawn terminal commands (fixes #1035) #1037
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🌐 Web query:
In Node.js child_process.spawn on Windows, when { shell: true } is used, can spawn(...) return a child PID even if the target executable (e.g., wt.exe) fails to launch, with failure only visible via quick shell exit?💡 Result:
Yes.
With
{ shell: true }on Windows,spawn()first launches a shell (by defaultprocess.env.ComSpec, typicallycmd.exe, using/d /s /c) and theChildProcessyou get back represents that shell process. Sochild.pidcan be a valid PID as long as the shell itself started successfully—even if the command inside the shell (e.g.,wt.exe) fails to launch, in which case the only sign may be that the shell prints an error tostderrand exits quickly with a non‑zero exit code. [1][2]In other words, that PID can be “real” but correspond to the shell wrapper, not the target executable; this wrapper-vs-real-command PID distinction is a known/observed behavior when using
shell:true. [3]What to check instead: listen for
error(shell failed to spawn) vsclose/exit+ exit code andstderr(command failed inside the shell). [2]Sources: [1] (nodejs.org) [2] (nodejs.org) [3] (stackoverflow.com)
Citations:
🏁 Script executed:
Repository: coleam00/Archon
Length of output: 82
🏁 Script executed:
Repository: coleam00/Archon
Length of output: 1137
🏁 Script executed:
Repository: coleam00/Archon
Length of output: 581
🏁 Script executed:
Repository: coleam00/Archon
Length of output: 598
🏁 Script executed:
Repository: coleam00/Archon
Length of output: 137
🏁 Script executed:
Repository: coleam00/Archon
Length of output: 93
🏁 Script executed:
Repository: coleam00/Archon
Length of output: 2579
🏁 Script executed:
Repository: coleam00/Archon
Length of output: 159
Removing
shell: truewill likely break path quoting for#1035; instead, detect wt.exe failure by listening to exit codes.The issue is real: with
shell: true,child.pidrepresents the shell process, not wt.exe. If wt.exe fails inside the shell,trySpawn()returnstrueanyway and the cmd.exe fallback never runs.However, the suggested fix (removing
shell: true) would revert the quoting behavior intentionally added in commit 8d91dde (issue#1035) to handle paths with spaces. The shell: true was added specifically so the shell parses the quoted path before passing it to wt.exe.Instead, keep
shell: truebut detect when the command inside the shell fails. Add event listeners toChildProcessforexitcode checking, or removestdio: 'ignore'temporarily to capture stderr when wt.exe fails. This preserves the quoting fix while properly detecting launch failure.🤖 Prompt for AI Agents