Merged
Conversation
Windows users whose username or installation directory contains spaces (e.g. C:\Users\John Doe\...) would hit failures when ClawX spawned uv, Python, Gateway, or ClawHub CLI processes with shell: true, because cmd.exe splits unquoted space-containing paths into separate tokens. Changes: - Add electron/utils/win-shell.ts with quoteForCmd(), needsWinShell(), and prepareWinSpawn() — pure utilities with no Electron dependency - uv-setup.ts: use needsWinShell() to only enable shell mode when PATH resolution is needed (simple command names); quote uvBin for safety - manager.ts: quote command and args when shell: true in dev-mode spawn - clawhub.ts: quote cliPath and args when shell: true - download-bundled-uv.mjs: use execFileSync instead of execSync for PowerShell extraction to avoid cmd.exe double-interpretation issues - Add 16 unit tests covering all quoting utilities Co-authored-by: Haze <hazeone@users.noreply.github.com>
|
Cursor Agent can help with this pull request. Just |
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.
Improve robustness for Windows paths with spaces in
child_process.spawn()calls to prevent installation and process startup failures.On Windows,
spawn(command, args, { shell: true })can fail if paths contain spaces becausecmd.exeinterprets them as argument separators. This PR introduces defensive quoting forcmd.exewhenshell: trueis necessary, and intelligently avoidsshell: truewhen an absolute path is provided, allowing the OS to handle spaces correctly.