Surface codex activity on the terminal tab via iTerm2 OSC 21337 tab status

Open 💬 2 comments Opened Jun 2, 2026 by gnachman

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:

  1. Base protocol wiring. Emit Working / Waiting / Idle as a colored dot + label. Gated on IsTerminal (so piped codex exec stays clean) and behind a new tui.tab_status config (default on, mirroring tui.terminal_title). Waiting is derived from the existing terminal_title_requires_action signal so the tab status and the action-required title share one source of truth.
  2. Shell-argv hardening. Relax the display-only command extraction so argv flattened past [shell, flag, script] still strips the zsh -lc wrapper; also improves the existing visible exec-history rendering for the same shape. Approval / canonical-identity matching stays strict.
  3. 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.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗