Skip to content

Ghostty: no per-tab TTY/PID — missing cross-reference and TTY switch fallback #63

@grimmerk

Description

@grimmerk

Summary

Ghostty and cmux lacks per-tab TTY/PID in their APIs, which prevents two capabilities that iTerm2 has:

  1. 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.

  2. 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
Ghostty PR #11354 — Expose PID/TTY on TerminalEntity Open Implementation in progress
cmux PR #2040(released) 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.

Related

🤖 On behalf of @grimmerk — generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions