Summary
The opencode TUI writes the terminal title exactly twice per session: OpenCode at startup and OC | <session title> once the session is named. It never repaints the title per turn, so a terminal tab / multiplexer / external observer cannot tell whether the agent is currently working or waiting for the user.
Why it matters
Tools that drive opencode in a pty (terminal multiplexers, orchestration daemons that show live session status, browser-based terminal tabs) already read OSC 0/2 title sequences as a zero-config status channel. Claude Code, for comparison, repaints its title with a spinner glyph while working and an idle glyph when it is the user's turn — which makes a terminal tab's status dot trivially derivable from the pty stream, with no API polling and no extra protocol.
For opencode today the honest answer is "unknown": opencode session list carries no live turn state, and the TUI emits no state-bearing title or private OSC.
Proposal
One (or both) of:
- Repaint the OSC 0/2 title with a turn-state glyph while a turn is running (e.g. a spinner phase while the model is working, a distinct glyph when the turn ends and it is the user's turn). A ~1s repaint cadence is plenty; the point is a derivable signal, not animation quality.
- Emit a private OSC sequence carrying the turn state (e.g.
OSC 777 ; opencode ; <state> with working|idle), which external observers can subscribe to without it affecting the visible tab title.
Either keeps the integration surface to "read the pty output" — no sockets, no polling, nothing that breaks under --auto headless use.
Environment
Verified against opencode 1.18.18 (TUI under a real pty): titles observed at startup and once per session, never per turn.
Summary
The opencode TUI writes the terminal title exactly twice per session:
OpenCodeat startup andOC | <session title>once the session is named. It never repaints the title per turn, so a terminal tab / multiplexer / external observer cannot tell whether the agent is currently working or waiting for the user.Why it matters
Tools that drive opencode in a pty (terminal multiplexers, orchestration daemons that show live session status, browser-based terminal tabs) already read OSC 0/2 title sequences as a zero-config status channel. Claude Code, for comparison, repaints its title with a spinner glyph while working and an idle glyph when it is the user's turn — which makes a terminal tab's status dot trivially derivable from the pty stream, with no API polling and no extra protocol.
For opencode today the honest answer is "unknown":
opencode session listcarries no live turn state, and the TUI emits no state-bearing title or private OSC.Proposal
One (or both) of:
OSC 777 ; opencode ; <state>withworking|idle), which external observers can subscribe to without it affecting the visible tab title.Either keeps the integration surface to "read the pty output" — no sockets, no polling, nothing that breaks under
--autoheadless use.Environment
Verified against opencode 1.18.18 (TUI under a real pty): titles observed at startup and once per session, never per turn.