Surface codex activity on the terminal tab via iTerm2 OSC 21337 tab status
What variant of Codex are you using?
CLI (TUI), on macOS / iTerm2.
What feature would you like to see?
Surface a backgrounded codex session's activity on the terminal tab using iTerm2's OSC 21337 tab-status protocol, so a long-running turn is visible without switching to the tab. OSC 21337 paints a colored dot and short label on the tab itself and is ignored silently by other terminals, so it's a no-op everywhere else.
Proposed as three small, independently reviewable pieces:
- Base protocol wiring. Emit Working / Waiting / Idle as a colored dot + label. Gated on
IsTerminal(so pipedcodex execstays clean) and behind a newtui.tab_statusconfig (default on, mirroringtui.terminal_title). Waiting is derived from the existingterminal_title_requires_actionsignal so the tab status and the action-required title share one source of truth. - Shell-argv hardening. Relax the display-only command extraction so argv flattened past
[shell, flag, script]still strips thezsh -lcwrapper; also improves the existing visible exec-history rendering for the same shape. Approval / canonical-identity matching stays strict. - Per-call detail. A detail string ("Run python3 build.py", "Read README.md"), continuity hints ("after: X" while thinking, "last: X" when idle), a 250 ms throttle, and sanitisation (control + Trojan-Source bidi/invisible stripping, shared with the terminal-title sanitiser).
Additional information
For context: I'm the maintainer of iTerm2. OSC 21337 tab-status support currently ships in the iTerm2 beta, so this feature has a visible effect there today; in terminals without OSC 21337 support (including iTerm2 stable) it's a silent no-op. Happy to advise on the protocol details.
Working, tested code is ready as a stacked set of branches in a public fork (gnachman/codex): pr-tab-status-base, pr-shell-command-joined, pr-tab-status-detail, reviewable as PRs https://github.com/gnachman/codex/pull/1 -> https://github.com/gnachman/codex/pull/2 -> https://github.com/gnachman/codex/pull/3 in that order.
Per docs/contributing.md (external code is invitation-only), I tried to open the upstream PR but CreatePullRequest is blocked for my account. If the team is open to this, I'd welcome an invitation to submit the stack, or am happy to have it taken over.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗