Emit OSC 7501 (program status) in cursor-agent — idle/working/blocked/done

Feature request for product/service

Cursor CLI

Describe the request

Have cursor-agent emit OSC 7501 status reports while running: idle, working, blocked (with kind=permission|question|auth), done, error, plus progress, title, and app=cursor.

Why

OSC 7501 is the emerging standard for a program to tell its terminal/multiplexer what it is doing. Claude Code (>= 2.1.295), Codex, Pi, omp, Devin and others already emit it, and multiplexers consume it for per-pane status, attention routing and notifications: Herdr, TUIOS, Termio, Vibe42, Warp-style tab states.

Today cursor-agent gives integrations two partial signals:

  • showStatusIndicators writes state into the terminal title (OSC 0/2): “Working…”, “Waiting for you”, “Ready”. Useful text, but it is not machine-readable state - a multiplexer must scrape the title to infer status, and it cannot distinguish idle vs blocked vs done reliably.
  • Hooks (hooks.json) fire at turn boundaries (stop, sessionStart, preToolUse), but the CLI fires no hook while the agent is waiting for approval or a question - the exact moment integrations care most about (“which of my 8 panes needs me?”).

With native 7501, a multiplexer can render a real status dot per pane, route attention on blocked, and notify on done - no scraping, no guessing.

Evidence this works today

The third-party w1 (Wrap7501) PTY wrapper already produces full 7501 for cursor-agent by watching the screen and ~/.cursor/chats session store: state, blocked kind, progress and title all flow correctly into OSC-7501-aware multiplexers. Native emission would replace that screen-scraping with ground truth - and fix the cases wrappers can’t see cleanly (canceled turns, inline approvals).

Proposed shape

  • On the OSC 7501;? support probe, answer with the declared capabilities, e.g. ]7501;?:states=idle,working,done,blocked,error:kinds=permission,question,auth (same answer Codex gives).
  • Emit on transitions: prompt submitted / turn start → working; turn finished → idle (or done when the user hasn’t seen it); approval/question prompt shown → blocked:kind=permission|question; cancel/interrupt → idle; exit after completing → done or error.
  • Carry app=cursor, a session/chat id (session=<chatId>), and the session title in title (from meta.json, already written).
  • Behind a config flag if emission must be opt-in (display.emitProgramStatus or similar); multiplexers advertise support via the probe anyway.

Related requests

  • “Expose reliable Cursor agent status events for integrations” - hooks were suggested; they still can’t see approval waits
  • “CLI: show idle / working / needs-approval in the terminal tab title, like Codex” - answered by showStatusIndicators; 7501 is the machine-readable version of the same feature
  • “Expose machine-readable ‘local agent session’ state (for third-party dashboards / automation)”

Hey @Anshul_Saini!

OSC 7501 for the Cursor CLI is something the team is looking at. No ETA to share, but definitely on our radar.