Skip to content

ClawX windows path robustness#171

Merged
hazeone merged 1 commit intomainfrom
cursor/clawx-windows-path-robustness-93e2
Feb 25, 2026
Merged

ClawX windows path robustness#171
hazeone merged 1 commit intomainfrom
cursor/clawx-windows-path-robustness-93e2

Conversation

@hazeone
Copy link
Copy Markdown
Contributor

@hazeone hazeone commented Feb 25, 2026

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 because cmd.exe interprets them as argument separators. This PR introduces defensive quoting for cmd.exe when shell: true is necessary, and intelligently avoids shell: true when an absolute path is provided, allowing the OS to handle spaces correctly.


Open in Web Open in Cursor 

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
Copy link
Copy Markdown

cursor bot commented Feb 25, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@hazeone hazeone marked this pull request as ready for review February 25, 2026 14:43
@hazeone hazeone merged commit 9a039ab into main Feb 25, 2026
2 checks passed
@hazeone hazeone deleted the cursor/clawx-windows-path-robustness-93e2 branch February 25, 2026 14:47
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.

2 participants