Repository navigation
Description
Feature hasn't been suggested before.
- I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
Please add Program Status Protocol (OSC 7501) reports to OpenCode's interactive terminal UI.
When running several agents in background terminal tabs, it is useful to know which is working, which needs approval or an answer, and which has finished. OSC 7501 gives supporting terminals structured state directly from the program, so they can choose how to display it without parsing screen contents or title glyphs.
Suggested state mapping, with app=opencode in each report:
idle: waiting for the next user prompt, including after a user cancellation.working: generating a response or executing tools.blocked:kind=permission: waiting for tool approval.blocked:kind=question: waiting for an answer to an interactive question.blocked:kind=auth: waiting for an interactive authentication step, where applicable.done: the turn completed and the result is ready to look at.error: the turn failed and stopped.
For example, with ESC/ST shown symbolically:
OSC 7501 ; state=working:app=opencode ST
OSC 7501 ; state=blocked:kind=permission:app=opencode ST
OSC 7501 ; state=done:app=opencode ST
Implementation details worth covering:
- Return to
workingafter an approval or answer when execution resumes. Preservedone/erroruntil the result is acknowledged or the user starts another turn, rather than immediately overwriting them withidle. - Optional
msgvalues must use base64 UTF-8 and respect the specification's length and control-character restrictions; avoid including credentials or sensitive prompt/tool content. - Keep reporting confined to terminal output; do not inject escape sequences into ACP, JSON, or other machine-readable output.
- Follow the protocol's cleanup semantics so a terminal is not left showing a stale active task after quitting.
- Feature detection is optional in revision 0.3: applications may send reports directly, and well-behaved terminals ignore unknown OSC sequences. No terminal-brand allowlist is needed.
Related requests: #43904 and #48482 ask for working/waiting state in OSC 0/2 terminal titles. OSC 7501 addresses the same workflow with structured states and blocking reasons, and can coexist with title updates and desktop notifications.
For a concrete implementation reference, Crush has already merged charmbracelet/crush#4041.
Activity
opencode-agent commentedon Oct 9, 2026
Thanks for the detailed proposal, @maxffarrell. You're asking for the TUI to send structured OSC 7501 Program Status reports (
working,blocked:kind=permission|question|auth,done,error,idle, all withapp=opencode). That would let supporting terminals show which background tab needs attention, without parsing titles or screen contents.I didn't find an existing request for OSC 7501. These related issues cover the same workflow through terminal titles or status indicators:
/sessionsshows a working spinner while waiting for an answer or permissionThe maintainers will consider it.
hackrdotsh commentedon Oct 10, 2026
I attempted an implementation for this for v2 specifically in #54402nevermind, implementation in #54560 now 😅