Skip to content

fix: detect cmux sessions with ghostty env#209

Merged
umputun merged 1 commit into
masterfrom
fix/cmux-ghostty-detection
May 22, 2026
Merged

fix: detect cmux sessions with ghostty env#209
umputun merged 1 commit into
masterfrom
fix/cmux-ghostty-detection

Conversation

@umputun
Copy link
Copy Markdown
Owner

@umputun umputun commented May 22, 2026

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

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.
Copilot AI review requested due to automatic review settings May 22, 2026 16:38
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_session detection (via CMUX_SURFACE_ID, __CFBundleIdentifier, and Ghostty env paths containing cmux.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.

@umputun umputun merged commit 8a4cfa8 into master May 22, 2026
9 checks passed
@umputun umputun deleted the fix/cmux-ghostty-detection branch May 22, 2026 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants