Skip to content

feat: cmux cross-reference detection via tree TTY#64

Merged
grimmerk merged 2 commits intodevelopfrom
feat/cmux-detection-cross-reference
Mar 29, 2026
Merged

feat: cmux cross-reference detection via tree TTY#64
grimmerk merged 2 commits intodevelopfrom
feat/cmux-detection-cross-reference

Conversation

@grimmerk
Copy link
Copy Markdown
Owner

Summary

cmux cross-reference for detection layer: fixes purple dot for bare claude or claude -r sessions with in-session /rename, same concept as iTerm2 cross-reference (PR #62).

How it works

Uses cmux CLI tree --all output which now includes a tty= field per surface (requires cmux PR: manaflow-ai/cmux#TBD):

  1. Check if cmux is running (pgrep -x cmux)
  2. Parse tree --all output for surfaces with tty= field
  3. For each cwd-fallback claude PID: ps -o tty= → match against cmux surface TTYs → get surface title
  4. Match surface title against custom titles → find correct session ID
  5. Correct PID-session mapping if needed

Test proof

Tested with cmux dev build containing TTY support:

[cross-ref-cmux] parsed surfaces with TTY: 4
  ttys021→"✳ Claude Code", ttys010→"✳ hi codex-ff 16", ttys006→"~/git/fred-ff", ttys020→"grimmer@MacBookAirK15:~/git/codex-ff"
[cross-ref-cmux] corrected PID 30689: b24197ae... → d34b3d48... (surface: "✳ hi codex-ff 16")

Purple dot correctly stayed on the /rename'd session after closing the other same-cwd session.

Dependencies

  • cmux: needs per-surface TTY in tree --all output (PR pending at manaflow-ai/cmux)
  • Without the cmux change, tree --all has no tty= field → cmuxSurfaces is empty → cross-reference gracefully skips

Related: #60, #63

🤖 On behalf of @grimmerk — generated with Claude Code

Same concept as iTerm2 cross-reference but uses cmux CLI
tree --all output with tty= field. Requires cmux build with
TTY support (cmux PR pending).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

1 participant