Keep cmux's bundled open shim first on PATH - #9781
Merged
Merged
Conversation
📝 WalkthroughWalkthroughThe shell integrations derive bundled command paths from ChangesBundled PATH resolution
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant CI
participant AppHostTests
participant ShellIntegration
participant BundledOpenShim
CI->>AppHostTests: run CmuxBundledBinPathIntegrationTests
AppHostTests->>ShellIntegration: source integration with CMUX_SHELL_INTEGRATION_DIR
ShellIntegration->>ShellIntegration: prepend bundled Resources/bin
AppHostTests->>BundledOpenShim: resolve open
BundledOpenShim-->>AppHostTests: return bundled shim path
Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (2 errors)
✅ Passed checks (23 passed)
✨ Finishing Touches🧪 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 |
This was referenced Aug 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #9471
Summary
Resources/binfrom the cmux-ownedCMUX_SHELL_INTEGRATION_DIRanchor instead of Ghostty's optionalGHOSTTY_BIN_DIR*/Resources/shell-integrationbundle shape so copied remote relay integrations keep their existingPATHGHOSTTY_BINorGHOSTTY_BIN_DIRWhy this boundary
GHOSTTY_BIN_DIRis downstream of the optional embedded Ghostty helper. When that helper variable is absent, cmux's existing first-prompt repair silently skips its own bundled commands.CMUX_SHELL_INTEGRATION_DIRis already exported for the bundled cmux integration and is also the anchor used to locate cmux's wrapper binaries, so it is the durable cmux-owned source for the adjacentResources/bindirectory.Regression proof
The two commits intentionally preserve red/green provenance:
0165c0e1fdadds and wiresCmuxBundledBinPathIntegrationTestsplus a non-tolerant focused CI gate. The test-only CI run failed with bash, fish, and zsh each resolving/usr/bin/openwhile both Ghostty helper variables were absent.71b0df20faapplies the shell-integration fix.The fixture launches the real shipped integrations from an app-bundle path containing spaces, sets
PATH=/usr/bin:/bin, omitsGHOSTTY_BINandGHOSTTY_BIN_DIR, and requirescommand -v opento resolve the fake bundle'sContents/Resources/bin/openshim.Validation
swiftc -typecheckforCmuxBundledBinPathIntegrationTests.swifttests/test_bash_integration_no_done_notifications.pytests/test_issue_5164_starship_prompt_composition.pyscripts/lint-pbxproj-test-wiring.sh(655test files)open; copied remote relay layouts leavePATH=/usr/bin:/binxcodebuildor XCUITest invocation, per task constraintAn exploratory run of
tests/test_ghostty_zsh_job_table_saturation_guard.pyhit its tight 1.5-second status-marker timeout once under local load. An extended diagnostic observed the expectedD;42marker, so that exploratory script is not claimed as a pass.Packaging audit
The current app resource build phase always builds
Contents/Resources/bin/ghosttyand fails the build if it is not executable. A successful current package should therefore contain the helper; an affected missing/non-executable install is likely old, corrupt, or runtime-mutated. This fix deliberately makes cmux'sopenrouting independent of that packaging state.Localization audit
No user-facing strings changed. The localization catalogs and web message catalogs are untouched.
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Note
Medium Risk
Changes shell startup PATH ordering for all integrated terminals; scope is limited to cmux-owned integration paths and regression tests, but incorrect path logic could break command resolution or remote shells.
Overview
Fixes #9471 by anchoring bundled-command
PATHrepair onCMUX_SHELL_INTEGRATION_DIRinstead of Ghostty’s optionalGHOSTTY_BIN_DIR, so cmux’sResources/bin(e.g. theopenshim) stays ahead of/usr/bineven when Ghostty helper env vars are missing.Bash, zsh, and fish integration now derive
Resources/binand the GUIMacOSdirectory from the*/Resources/shell-integrationlayout, prepend the bundled bin dir, and skip the GUI binary so it cannot shadow the CLI. Fish adds_cmux_fix_pathafter user config (with optional GUI-dir skipping in path prepend) so user startup cannot undo precedence; remote relay layouts without that bundle shape are left unchanged.Adds
CmuxBundledBinPathIntegrationTests(bash/fish/zsh resolve a fake bundleopenshim withPATH=/usr/bin:/binand no Ghostty vars) and a non-tolerant focused CI step on the app-host regression shard. Updatestests/test_claude_wrapper_user_binary_resolution.pyfor bundled-bin ordering in bash/zsh.Reviewed by Cursor Bugbot for commit b04f3e8. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by cubic
Keep cmux’s bundled
openshim first on PATH across bash, zsh, and fish by anchoring onCMUX_SHELL_INTEGRATION_DIRand restoring precedence after user startup. Fixes #9471 and adds a focused CI check and tests to prevent PATH regressions.Resources/binand GUIMacOSfromCMUX_SHELL_INTEGRATION_DIR; stop relying onGHOSTTY_BIN_DIRand do not create/modifyGHOSTTY_BIN*.Contents/MacOSentry when prepending.*/Resources/shell-integrationlayout so remote relays keep their PATH.CmuxBundledBinPathIntegrationTestsand a non-tolerant focused CI step; install fish in CI and keep fish coverage optional locally; make the fish regression non-interactive and deterministic.tests/test_claude_wrapper_user_binary_resolution.pyto assert bundled-bin precedence in bash/zsh and call_cmux_fix_pathin zsh.Written for commit 588ebec. Summary will update on new commits.
Summary by CodeRabbit
Bug Fixes
Tests