Skip to content

Commit e7b5580

Browse files
committed
Use path.posix.join for overflow path to preserve POSIX separators
Fixes Windows + SSH runtime compatibility. config.runtimeTempDir is always a POSIX path (e.g., /home/user/.cmux-tmp/token) even when cmux runs on Windows. Using path.join() would convert it to backslash form on Windows, breaking SSHRuntime.writeFile() which expects forward slashes. Solution: Always use path.posix.join() when constructing paths for runtime operations, regardless of host OS. Addresses Codex review comment PRRT_kwDOPxxmWM5fYEbF
1 parent 5a88fc4 commit e7b5580

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/services/tools/bash.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -420,8 +420,9 @@ export const createBashTool: ToolFactory = (config: ToolConfiguration) => {
420420
// Use 8 hex characters for short, memorable temp file IDs
421421
const fileId = Math.random().toString(16).substring(2, 10);
422422
// Write to runtime temp directory (managed by StreamManager)
423-
// This works for both LocalRuntime (local path) and SSHRuntime (remote path)
424-
const overflowPath = path.join(config.runtimeTempDir, `bash-${fileId}.txt`);
423+
// Use path.posix.join to preserve forward slashes for SSH runtime
424+
// (config.runtimeTempDir is always a POSIX path like /home/user/.cmux-tmp/token)
425+
const overflowPath = path.posix.join(config.runtimeTempDir, `bash-${fileId}.txt`);
425426
const fullOutput = lines.join("\n");
426427

427428
// Use runtime.writeFile() for SSH support

0 commit comments

Comments
 (0)