You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Ghostty: no per-tab TTY/PID — missing cross-reference and TTY switch fallback #63
Ghostty and cmux lacks per-tab TTY/PID in their APIs, which prevents two capabilities that iTerm2 has:
Detection cross-reference — for bare claude or claude -r sessions with in-session /rename, iTerm2 can match PID → TTY → tab name → custom title → session ID. Ghostty/cmux cannot do this, so the purple dot may be on the wrong session.
Switch TTY fallback — for -r <uuid> sessions without /rename, iTerm2 can use TTY matching to switch to the correct tab even without a custom title. Ghostty/cmux fall back to cwd matching which may switch to the wrong tab.
What's needed
Either per-tab TTY or PID exposed via the terminal's API (AppleScript or CLI). Either one enables cross-referencing with claude process TTYs (ps -o tty=).
Upstream tracking
Terminal
Item
Status
Impact
Ghostty
Issue #11592 — Add pid/tty to AppleScript terminal class
Open
Would enable both cross-reference and TTY switch fallback
Could expose per-surface TTY via CLI (list-pane-surfaces or similar)
Current workaround
Users should use claude -n "name" or /rename + exit + resume for same-cwd sessions on Ghostty/cmux. See README and design doc for the full accuracy matrix.
Update: cmux per-surface TTY is now supported via manaflow-ai/cmux#2040 (merged). CodeV cmux cross-reference detection implemented in PR #64 (merged).
Remaining: Ghostty still lacks per-tab TTY/PID — pending upstream ghostty#11592.
Note: With the discovery of ~/.claude/sessions/ (#65), cross-reference may become unnecessary for detection — sessions/<PID>.json provides direct PID→sessionId mapping. Cross-reference would still be needed for switch layer TTY matching on Ghostty (once TTY is available upstream).
🤖 On behalf of @grimmerk — generated with Claude Code
changed the title [-]Ghostty/cmux: no per-tab TTY/PID — missing cross-reference and TTY switch fallback[/-][+]Ghostty: no per-tab TTY/PID — missing cross-reference and TTY switch fallback[/+]on Mar 31, 2026
Update: Ghostty tip builds now expose per-terminal tty and pid (ghostty-org/ghostty#11922, merged; not yet in a release as of v1.3.1). #165 uses it for both items listed above: the switch layer (tty and title in pid-provenance order, then cwd) and Ghostty's branch of crossRefDisambiguate. Measured on tip build 18371: with 16 terminals sharing one directory, the old cwd-only switch sent every un-renamed session to the same tab; by tty each reached its own. Stable Ghostty keeps today's title → cwd behaviour, since the property is read by its raw code inside try.
🤖 On behalf of @grimmerk — generated with Claude Code
Activity
grimmerk commentedon Mar 30, 2026
Update: cmux per-surface TTY is now supported via manaflow-ai/cmux#2040 (merged). CodeV cmux cross-reference detection implemented in PR #64 (merged).
Remaining: Ghostty still lacks per-tab TTY/PID — pending upstream ghostty#11592.
Note: With the discovery of
~/.claude/sessions/(#65), cross-reference may become unnecessary for detection —sessions/<PID>.jsonprovides direct PID→sessionId mapping. Cross-reference would still be needed for switch layer TTY matching on Ghostty (once TTY is available upstream).🤖 On behalf of @grimmerk — generated with Claude Code
grimmerk commentedon Mar 30, 2026
Update: cmux now has three-layer switch matching (title → TTY → cwd), same as iTerm2. PR #69.
Remaining: Ghostty still lacks per-tab TTY — pending ghostty#11354. When Ghostty adds TTY/PID support, the changes needed in CodeV are:
openSessionInGhostty(same pattern as iTerm2/cmux —ps -o tty=→ match against Ghostty tab TTYs)crossRefDisambiguatealready has a placeholder (byTerminal['ghostty']→ cwd fallback) — replace with TTY matchingBoth are small changes once upstream support lands.
🤖 On behalf of @grimmerk — generated with Claude Code
[-]Ghostty/cmux: no per-tab TTY/PID — missing cross-reference and TTY switch fallback[/-][+]Ghostty: no per-tab TTY/PID — missing cross-reference and TTY switch fallback[/+]00-kat commentedon Apr 24, 2026
I have absolutely no clue what CodeV is, I come here from GitHub's xref in ghostty-org/ghostty#11354; FYI, selecting a TTY/PID is now supported on tip, xref ghostty-org/ghostty#10756, ghostty-org/ghostty#11592, and ghostty-org/ghostty#11922. This will make it into a release around September (unless it's backported to 1.3, which I doubt).
grimmerk commentedon Oct 22, 2026
Update: Ghostty tip builds now expose per-terminal
ttyandpid(ghostty-org/ghostty#11922, merged; not yet in a release as of v1.3.1). #165 uses it for both items listed above: the switch layer (tty and title in pid-provenance order, then cwd) and Ghostty's branch ofcrossRefDisambiguate. Measured on tip build 18371: with 16 terminals sharing one directory, the old cwd-only switch sent every un-renamed session to the same tab; by tty each reached its own. Stable Ghostty keeps today's title → cwd behaviour, since the property is read by its raw code insidetry.🤖 On behalf of @grimmerk — generated with Claude Code