Compare commits

...

3 Commits

Author SHA1 Message Date
Claude Bot
de81f16c60 Move regression test to test/regression/issue/26597.test.ts
Per CLAUDE.md guidelines, tests for specific GitHub issues should be
placed in test/regression/issue/${issueNumber}.test.ts for consistency
and discoverability.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 19:50:34 +00:00
Claude Bot
9c595ba596 Merge branch 'main' into claude/fix-parallel-windows-backslash
Resolve conflict in multi_run.zig - keep main's explicit Windows check
(Environment.isWindows and raw_name[0] == '\\') instead of the more
generic std.fs.path.sep approach.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 19:28:48 +00:00
Claude Bot
92d7c2fe75 fix(cli): quote bun path in parallel file execution on Windows
When running files in parallel with `bun --parallel a.js b.js`, the bun
executable path was being passed unquoted to `bun exec`. On Windows, this
caused the backslashes in paths like `C:\Users\...\bun.exe` to be
interpreted as escape characters by the shell parser, resulting in
malformed paths like `C:Usersjake.bunbinbun.exe` and a "command not
found" error.

The fix quotes the bun path so backslashes are preserved. Also adds
detection for Windows paths starting with backslash in the `is_file`
check.

Fixes #26597

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 06:35:36 +00:00

View File

@@ -0,0 +1,28 @@
// https://github.com/oven-sh/bun/issues/26597
// Parallel file execution should work on Windows when bun path contains backslashes
import { expect, test } from "bun:test";
import { bunEnv, bunExe, tempDir } from "harness";
test("#26597: parallel file execution works (Windows backslash path handling)", async () => {
using dir = tempDir("issue-26597", {
"a.js": "console.log('hello-a')",
"b.js": "console.log('hello-b')",
});
// This previously failed on Windows with "bun: command not found: C:Usersjake.bunbinbun.exe"
// because backslashes in the bun executable path were being stripped by the shell parser.
await using proc = Bun.spawn({
cmd: [bunExe(), "run", "--parallel", "a.js", "b.js"],
env: { ...bunEnv, NO_COLOR: "1" },
cwd: String(dir),
stderr: "pipe",
stdout: "pipe",
});
const [stdout, stderr, exitCode] = await Promise.all([proc.stdout.text(), proc.stderr.text(), proc.exited]);
// Both scripts should run and produce prefixed output
expect(stdout).toMatch(/a\.js\s+\| .*hello-a/);
expect(stdout).toMatch(/b\.js\s+\| .*hello-b/);
expect(exitCode).toBe(0);
});