Repository navigation
Fix Ghostty SSH wrapper path in embedded app bundles - #8109
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughThe Ghostty fork is updated and its CLI path contract is documented. Runtime surface creation now exports an executable ChangesGhostty CLI path integration
Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested reviewers: ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Greptile SummaryThis PR fixes the Ghostty SSH wrapper failure in embedded app bundles by introducing
Confidence Score: 4/5Safe to merge; the core path fix is correct and well-tested, with one minor inconsistency in the filesystem abstraction used. The Swift change is small, correctly guarded by an executable check, and consistent with how other bundled paths are handled in the same function except for one filesystem abstraction inconsistency. All other changed files (docs, checksums, submodule, test) look correct. TerminalSurface+RuntimeSurfaceCreation.swift — the new GHOSTTY_BIN guard uses FileManager.default instead of the injected runtimeFilesystem used just above it. Important Files Changed
Sequence Diagram%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
participant cmux as cmux Swift
participant FS as runtimeFilesystem
participant Env as Managed Env
participant Shell as Shell integration
cmux->>FS: isExecutableFile(Contents/Resources/bin/ghostty)
alt helper executable
FS-->>cmux: true
cmux->>Env: "GHOSTTY_BIN = bundled helper path"
Env->>Shell: "ssh wrapper calls exec GHOSTTY_BIN +ssh -- user@host"
else helper absent
FS-->>cmux: false
cmux->>Env: GHOSTTY_BIN not set
Env->>Shell: no SSH wrapper installed
end
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
participant cmux as cmux Swift
participant FS as runtimeFilesystem
participant Env as Managed Env
participant Shell as Shell integration
cmux->>FS: isExecutableFile(Contents/Resources/bin/ghostty)
alt helper executable
FS-->>cmux: true
cmux->>Env: "GHOSTTY_BIN = bundled helper path"
Env->>Shell: "ssh wrapper calls exec GHOSTTY_BIN +ssh -- user@host"
else helper absent
FS-->>cmux: false
cmux->>Env: GHOSTTY_BIN not set
Env->>Shell: no SSH wrapper installed
end
Reviews (1): Last reviewed commit: "test: cover Ghostty fish SSH feature var..." | Re-trigger Greptile |
| if FileManager.default.isExecutableFile(atPath: ghosttyCLIPath) { | ||
| setManagedEnvironmentValue("GHOSTTY_BIN", ghosttyCLIPath) | ||
| } |
There was a problem hiding this comment.
The adjacent
CMUX_BUNDLED_CLI_PATH guard (a few lines earlier) uses the injected runtimeFilesystem.isExecutableFile() abstraction for the same kind of check. The new GHOSTTY_BIN guard goes directly to FileManager.default, bypassing the injectable seam and making this branch untestable through the same mechanism the rest of the function uses.
| if FileManager.default.isExecutableFile(atPath: ghosttyCLIPath) { | |
| setManagedEnvironmentValue("GHOSTTY_BIN", ghosttyCLIPath) | |
| } | |
| if runtimeFilesystem.isExecutableFile(ghosttyCLIPath) { | |
| setManagedEnvironmentValue("GHOSTTY_BIN", ghosttyCLIPath) | |
| } |
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Summary
<GUI executable dir>/ghosttyRoot cause
Ghostty derived
GHOSTTY_BIN_DIRfromselfExePath()and every SSH shell wrapper appended/ghostty. In a GhosttyKit host,selfExePath()is cmux, so the wrapper constructed/Applications/cmux.app/Contents/MacOS/ghostty. cmux actually ships the Ghostty CLI helper atContents/Resources/bin/ghostty.The fix introduces one full executable-path contract,
GHOSTTY_BIN. Native Ghostty resolves it to its own executable; cmux sets it to its bundled helper.GHOSTTY_BIN_DIRremains only the directory used by the independent PATH feature. Embedded hosts without a helper do not install a broken SSH wrapper.Affected users
Ghostty defaults
ssh-envandssh-terminfoto off, so ordinary sessions without either feature do not define the wrapper and will not reproduce the bug. It affects sessions where either feature is enabled by Ghostty config or cmux remote/bootstrap behavior. A separately installed Ghostty does not determine the outcome because the old wrapper directly executed the derived bundle path instead of searchingPATH.Regression proof
The test-only change was merged separately as #8102. Against the old submodule it invokes the actual zsh integration and fails with exit 127 and
ssh:4: no such file or directory: .../cmux.app/Contents/MacOS/ghostty, matching #8093. Against this fixed head the same zsh and bash behavior checks invoke the host-provided helper as+ssh -- user@example.comand pass.Verification
python3 tests/test_issue_8093_ghostty_ssh_binary_path.pyb4b6d69c8, archive validator passed, GitHub asset digest pinned as89a2d738fc566c9c91e2c0ed7c2c9fa9f6ac18d9f0541fd9ff58e41bb8b8caa9./tests/test_ci_ghosttykit_checksum_present.sh./tests/test_ci_ghosttykit_checksum_verification.shpython3 scripts/check-package-resolved-policy.pypython3 scripts/check-workspace-package-groups.py --checkCloses #8093
Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.Summary by cubic
Fixes SSH shell wrapper failures in embedded bundles by exporting the exact Ghostty CLI path via GHOSTTY_BIN, so shells call the bundled helper instead of a reconstructed path. Adds tests for fish ssh-env/ssh-terminfo variants. Fixes #8093.
Bug Fixes
Dependencies
ghosttysubmodule to include the CLI path contract.GhosttyKitrelease checksum inscripts/ghosttykit-checksums.txt; docs updated.Written for commit b05b779. Summary will update on new commits.
Summary by CodeRabbit
New Features
Bug Fixes
Documentation