Commit 8594d50
committed
🤖 Fix tilde (~/) path expansion in SSH exec
Fix bug where tilde paths like ~/cmux/project didn't work for SSH workspaces.
Problem:
- Bash doesn't expand ~ when it's inside quotes
- `cd "~/path"` fails, but `cd ~/path` works
- Previous code did: `cd ${JSON.stringify(cwd)}` which quoted the path
- Tests used absolute paths (/home/...) so bug was not caught
Solution:
- Expand ~/path to $HOME/path before quoting
- `cd "$HOME/path"` works because $HOME expands inside quotes
- Only affects SSH runtime (local runtime doesn't use exec)
Test coverage:
- Added new test: "handles tilde (~/) paths correctly (SSH only)"
- Uses ~/workspace/... instead of absolute path
- All 14 integration tests now passing
Why tests didn't catch it:
- SSH test fixture used hardcoded absolute path: /home/testuser/workspace
- Real users often use tilde paths in config (~/projects, ~/cmux, etc.)
- New test ensures tilde paths work end-to-end
_Generated with `cmux`_1 parent 96ff890 commit 8594d50
File tree
2 files changed
+55
-1
lines changed- src/runtime
- tests/ipcMain
2 files changed
+55
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
65 | 71 | | |
66 | | - | |
| 72 | + | |
67 | 73 | | |
68 | 74 | | |
69 | 75 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
489 | 489 | | |
490 | 490 | | |
491 | 491 | | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
492 | 540 | | |
493 | 541 | | |
494 | 542 | | |
| |||
0 commit comments