Terminal support for CLI notifications via OSC9 (ESC ] 9 ; <message> BEL)
#47726
Replies: 2 comments 3 replies
-
|
+1 to this. Coming from Ghostty where OSC9/OSC777 notifications work out of the box with Claude Code, the absence of this in Zed's terminal is worrying, especially when running long agentic tasks. I use Claude Code, and it fires a The workaround is setting up a If this is pulled off, this would make Zed a first-class terminal for agentic CLI workflows (Claude Code, Codex, etc.) rather than requiring users to drop back into Ghostty or iTerm2, or using notification hook for a better notification experience. I'll be happy to open a PR, if the maintainers will accept this proposal. |
Beta Was this translation helpful? Give feedback.
-
|
My use case is now covered by agent threads & the new agent panel. Thanks so much! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Disclosure: I used
codexCLI to gather the context to write this post. I tried to do it thoughtfully, and I verified its output to the best of my ability. This post in its entirety was written by me, a verifiable human. I don't have worldcoin tho.Problem
Zed's Terminal doesn't currently support forwarding notifications from CLI's that emit OSC9 escaped messages (
ESC ] 9 ; <message> BEL).This adds friction for workflows which depend upon being notified of task completion. Zed users must manually poll for results by switching to & from the terminal running the process. This can cause Zed users to miss progress updates and possibly lose time.
Solving this problem will save Zed users time and make the built in terminal more broadly useful. This will hopefully drive retention to the editor because of its excellent terminal experience.
Example workflow
A popular workflow supported by this is coding with the
codexCLI.A developer prompts codex in a popular terminal (like ghostty, which supports parsing OSC9). They prompt
codex, building up a plan which gives them high confidence. The developer agrees on the plan withcodexand then asks the agent to run with the task.The task will be long-running process and the developer wants to begin planning another task with an agent in a different tab. They open a tab and begin building the context required to perform another task.
The original
codexloop gets stuck asking for permissions to execute a command. The developer receives a notification and unblocks the agent. They do this by clicking the notification and the pane / tab / window which sent the notification is activated. They accept the prompt and continue planning.This is not possible today when using CLI agents within Zed terminal. Zed users do not receive a notification and may lose the time that the agent sits blocked until they notice.
My dream workflow
I'd love to be able to run the terminal in a zoomed-in mode (SHIFT+ESC) and either use panes to run multiple
codexagents, or separate terminals. When an agent turn ends, or it needs to be unblocked, I'd receive a pop-up (much like the Agent Panel pop-ups today). Clicking the pop-up would activate the terminal pane or tab that sent the notification.Context and possible implementation
Helpful context
codexemits messages using OSC9.osc_dispatchansi.rsESC ] 9 ; 4 ; .... BEL), and this change could make it easier to implement progress indicators in the Zed terminal.I think Zed depends on vte -- it lists a pinned fork, whose version aligns with a recent tag from the upstream repository.
How it could be implemented
In vte:
b"9"inosc_dispatchpub trait Handlerwith a fn that accepts amessageIn alacritty_terminal:
Event::Notification(String)to alacritty_terminal/src/event.rsIn Zed:
Alacritty::Notificationevent to a Zed terminal event in zed/crates/terminal/src/terminal.rsBeta Was this translation helpful? Give feedback.
All reactions