Skip to content

osc: parse the Kitty desktop notification protocol (OSC 99) - #10467

Closed
jcollie wants to merge 8 commits into
ghostty-org:mainfrom
jcollie:osc-kitty-notifications
Closed

jcollie wants to merge 8 commits into
ghostty-org:mainfrom
jcollie:osc-kitty-notifications

Conversation

@jcollie

@jcollie jcollie commented Jan 27, 2026 •

Copy link
Copy Markdown
Member

This includes only parsing of the OSC. You cannot (yet) use OSC 99 to send notifications. Uses lazy parsing of the metadata modelled on the new OSC 133 behavior.

Related to #5634

@jcollie
jcollie requested a review from a team as a code owner January 27, 2026 16:33

@pluiedev pluiedev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First round of reviews, definitely not exhaustive since there's a ton to go through

Comment thread src/terminal/osc/parsers/kitty_desktop_notification.zig
Comment thread src/terminal/osc/parsers/kitty_desktop_notification.zig Outdated
@jcollie
jcollie force-pushed the osc-kitty-notifications branch 2 times, most recently from c726052 to ffaf0c2 Compare January 29, 2026 20:50
Comment thread src/terminal/osc/parsers/kitty_desktop_notification.zig Outdated
Comment thread src/terminal/osc/parsers/kitty_desktop_notification.zig Outdated
Comment thread src/terminal/osc/parsers/kitty_desktop_notification.zig Outdated
Comment thread src/terminal/osc/parsers/kitty_desktop_notification.zig Outdated
Comment thread src/terminal/osc/parsers/kitty_desktop_notification.zig Outdated
@jcollie
jcollie force-pushed the osc-kitty-notifications branch from ffaf0c2 to 8ae4dd9 Compare February 1, 2026 19:39

@pluiedev pluiedev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment thread src/terminal/osc/parsers/kitty_desktop_notification.zig Outdated
@jcollie
jcollie force-pushed the osc-kitty-notifications branch from 8ae4dd9 to d412b3c Compare February 16, 2026 23:14
joelmoss added a commit to joelmoss/workroom that referenced this pull request Jun 5, 2026
Checked ghostty 'main' (the dev tip, not just the 1.2.3 release): there's no
OSC-99 parser today, but OSC 99 support is an OPEN upstream PR
(ghostty-org/ghostty#10467, 'parse the Kitty desktop notification protocol').
So it's coming, not a permanent non-feature. Update QA §H + the xcframework
re-verify note: build the xcframework from a ghostty ref that includes #10467
(or cherry-pick it) to restore OSC 99; ghostty's in-progress libghostty
fallback-handler for unknown OSC is an alternate app-side path. OSC 9/777
cover the common cases meanwhile.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@rockorager

Copy link
Copy Markdown
Member

Would like to use this! Is it ready to go still?

@jcollie

jcollie commented Jun 11, 2026

Copy link
Copy Markdown
Member Author

Would like to use this! Is it ready to go still?

Other than a rebase I think that this is still ready to go.

@jcollie
jcollie force-pushed the osc-kitty-notifications branch from 8034b93 to a591987 Compare June 11, 2026 04:35
@jcollie

jcollie commented Jun 11, 2026

Copy link
Copy Markdown
Member Author

Pushed a rebase.

jcollie added 8 commits August 1, 2026 10:24
This includes only parsing of the OSC. You cannot use OSC 99 to send
notifications. Uses lazy parsing of the metadata modelled on the new OSC
133 behavior.
* Add comments to Option keys to clarify their usage without having
  to refer to the spec online.
* Use `indexOfNone` to simplify code.
* Fix typos.
* Eliminate metadata parsing code duplication.
* Improve documentation.
* Ensure assert is comptime only.
* Derive valid metadata characters from valid identifier characters.
Reduce redundant code by sharing the metadata parsing code
between the OSC 99 & OSC 5522 parsers.
@jcollie
jcollie force-pushed the osc-kitty-notifications branch from a591987 to c08f965 Compare August 1, 2026 15:38
@mitchellh

Copy link
Copy Markdown
Contributor

Merged! Sorry did local review so couldn't go through PR, but authorship retained.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants