fix: detect cmux sessions with ghostty env#209
Merged
Conversation
Route cmux sessions through the cmux launcher when newer cmux versions expose Ghostty environment variables without CMUX_SURFACE_ID. This prevents the launcher from falling into the Ghostty AppleScript path and closing the parent session. Update the Claude, Codex, and plan-review launchers, add focused launcher coverage, refresh docs, and bump affected plugin package versions.
There was a problem hiding this comment.
Pull request overview
This PR adjusts terminal-session detection so cmux sessions that inherit Ghostty environment variables (but don’t expose CMUX_SURFACE_ID) are still routed through the cmux CLI launcher path, avoiding the Ghostty AppleScript branch. This targets the cmux + Claude Code behavior described in #202 and keeps the various launcher copies and docs in sync.
Changes:
- Add
is_cmux_sessiondetection (viaCMUX_SURFACE_ID,__CFBundleIdentifier, and Ghostty env paths containingcmux.app) and use it to gate the cmux CLI branch ahead of Ghostty. - Extend launcher tests to cover the “cmux session with Ghostty env vars” scenario.
- Update README/site/plugin docs and bump affected plugin/package versions.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
plugins/revdiff-planning/scripts/launch-plan-review.sh |
Detect cmux sessions via Ghostty env and route to cmux CLI branch (with explicit error if cmux CLI missing). |
plugins/codex/skills/revdiff/scripts/launch-revdiff.sh |
Same cmux-vs-ghostty detection fix for the Codex launcher copy. |
.claude-plugin/skills/revdiff/scripts/launch-revdiff.sh |
Same cmux-vs-ghostty detection fix for the Claude plugin launcher copy. |
app/plugin_exit_code_test.go |
Adds coverage for cmux sessions exposing Ghostty env vars; expands cleaned env set accordingly. |
README.md |
Updates terminal detection/docs and sandbox note snippet key. |
site/index.html |
Updates terminal detection text for cmux and ghostty. |
site/docs.html |
Updates terminal detection table/priority explanation for cmux and ghostty. |
plugins/revdiff-planning/README.md |
Documents the updated cmux detection priority vs Ghostty. |
plugins/codex/skills/revdiff/references/install.md |
Documents the updated cmux detection priority vs Ghostty. |
.claude-plugin/skills/revdiff/references/install.md |
Documents the updated cmux detection priority vs Ghostty. |
plugins/revdiff-planning/.claude-plugin/plugin.json |
Version bump for revdiff-planning plugin. |
.claude-plugin/plugin.json |
Version bump for revdiff Claude plugin. |
.claude-plugin/marketplace.json |
Version bumps to match plugin.json updates. |
package.json |
Version bump for the Pi package. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Detect cmux sessions that expose Ghostty environment variables but no
CMUX_SURFACE_ID, and route them through the cmux CLI launcher instead of the Ghostty AppleScript branch.This updates the Claude, Codex, and plan-review launcher copies, adds focused launcher coverage for the cmux/Ghostty-env case, refreshes README/site/plugin docs, and bumps affected plugin/package versions.
Related to #202