Programs Already Know Their Status. A New Terminal Protocol Lets Them Tell Us.
A Terminal Protocol for Program Status (OSC 7501)
Mitchell Hashimoto proposes OSC 7501, a terminal-native protocol for programs to report their status: idle, working, blocked, done, or error. It uses simple key=value pairs over the pty, avoiding fragile screen-scraping heuristics and per-tool APIs. The spec includes hierarchical task IDs and base64 messages, and is already implemented in Ghostty, Rex, Terraform, and Claude Code.
I'd like us all to stop guessing what programs are doing by reading their screens or process trees. The program already knows. Let's give it a way to tell us!
- drewg123
The BSDs have had a version of this for many, many years. If you hit ^T on the terminal, you deliver a SIGINFO to the application you're waiting for. By default, you get the program name, what its blocked on, and info about real/user/sys time and memory use.
Starting an emacs window in the fg:
% emacs
^T
load: 0.32 cmd: emacs-31.1 64938 [select] 2.89r 0.75u 0.06s 6% 122404k
- Vegenoid
I like the idea, but we already have the terminal bell. In my setup, when an agent is done or needs something, it emits a bell. Based on config, this results in a desktop notification if I’m not in the terminal, or a toast from my multiplexer if I’m in the terminal. The terminal pane gets a colored “bell” icon in its title that is cleared when I attach to it.
The total lack of mention of the terminal bell in the article is weird. I think it needs to be addressed for the protocol to be taken seriously. More granular info sounds nice, but also nice is the simplicity of the bell.
- eschaton
How does this compare to setting the status line on a terminal that supports one?
- bugcheck7b
Cool to see this, I've been toying around with custom notification OSCs through zellij and ghostty.
Totally going to extend this for myself with a custom key that encodes a reverse route on each hop so I can easily jump to the window/tab/pane that emitted it, or send back custom actions into a given pane like a permission approve/deny.
- weinzierl
I've been using a poor mans version of this for decades.
My iTerm2 is configured to show activity, new-output and visual bell in the tab. On Linux I have an approximation for WezTerm.
I have a bell command that I can use in a pipeline or sequence to produce the bell on events I'm interested in. Trivial case is when a program finishes.
I have a fancy alias that can be used in a shell command sequence and which produces different sounds depending on the exit status of the preceding command in addition to sending the terminal bell.