Fix Windows path handling for usernames with spaces

On Windows, when the username contains spaces (e.g., "Tafari Higgs"),
bun-runner.js fails with: Syntax Error at C:\Users\Tafari:1:2

This happens because `shell: IS_WINDOWS` (true on Windows) causes
spawn() to route through cmd.exe, which misinterprets the path at
the first space in the username directory.

Removing `shell: true` on Windows fixes the issue since spawn()
can invoke the Bun binary directly without needing a shell wrapper.
Added `windowsHide: true` to prevent a visible console window from
appearing, matching the previous hidden behavior under cmd.exe.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Tafari Higgs
2026-02-05 13:06:09 -05:00
committed by Alex Newman
parent 2ea716a017
commit c9010c5c58
+3 -1
View File
@@ -72,9 +72,11 @@ if (!bunPath) {
// Spawn Bun with the provided script and args
// Use spawn (not spawnSync) to properly handle stdio
// Note: Don't use shell mode on Windows - it breaks paths with spaces in usernames
// Use windowsHide to prevent a visible console window from spawning on Windows
const child = spawn(bunPath, args, {
stdio: 'inherit',
shell: IS_WINDOWS,
windowsHide: true,
env: process.env
});