Skip to content

events(feat[notify]): Add OSC notifications (#31) - #56

Merged
tony merged 1 commit into
masterfrom
feat/osc-notifications
Nov 28, 2026
Merged

tony merged 1 commit into
masterfrom
feat/osc-notifications

Conversation

@tony

@tony tony commented Nov 28, 2026

Copy link
Copy Markdown
Member

Closes #31 (depends on #55)

Summary

Adds typed Notification (NotificationSource, NotificationUrgency, included in KnownEvent) parsing for iTerm2 OSC 9, chunked Kitty OSC 99, and rxvt OSC 777;notify sequences.

What changed

  • libvt.events & docs/api/events.md: add NotificationSource (osc_9, osc_99, osc_777), NotificationUrgency (low, normal, high), and Notification, and include Notification in KnownEvent.
  • libvt.config: add Policy.allow_notifications (True), Policy.allow_notification_queries (False), Limits.max_pending_notifications (16, FIFO eviction), and Limits.max_notification_bytes (16_384).
  • libvt.terminal.Terminal: parse OSC 9 (routing 9;4 to ProgramStatusStore, 9;9 to WorkingDirectoryChanged, ignoring other ConEmu 9;1..9;12 subcommands), chunked Kitty OSC 99 (d=0/d=1 including anonymous i="", raw byte buffering prior to UTF-8 decode across multi-chunk payloads, unpadded e=1 Base64 validation, p=title/p=body/p=? capability queries, u=0..2), and OSC 777;notify;<title>;<body> with C0/C1/DEL sanitization, post-sanitization UTF-8 byte caps, and RIS state reset.
  • tests/test_terminal.py, tests/test_status.py, docs/topics/protocols-and-input.md, and CHANGES: unit tests, doctests, and documentation.

@tony
tony force-pushed the feat/stateful-xtsmgraphics branch from d0e040f to 7b23a31 Compare November 28, 2026 20:17
@tony
tony changed the base branch from feat/stateful-xtsmgraphics to master November 28, 2026 20:20
why: Terminal applications emit desktop notifications via iTerm2 OSC 9,
chunked Kitty OSC 99, and rxvt OSC 777;notify that callers need as
sanitized, bounded, typed Event records.

what:
- Add NotificationSource, NotificationUrgency, and Notification (in
  KnownEvent) plus Policy.allow_notifications,
  Policy.allow_notification_queries, Limits.max_pending_notifications,
  and Limits.max_notification_bytes
- Parse OSC 9 (filtering ConEmu 9;1..9;12), chunked Kitty OSC 99 (raw
  byte buffering across e=0/e=1 Base64 chunks, d=0/d=1, p=?, u=0..2),
  and OSC 777;notify in Terminal with C0/C1/DEL sanitization and byte caps
- Document and test notification parsing across events, terminal, and docs
@tony
tony force-pushed the feat/osc-notifications branch from 9773411 to d4d03b3 Compare November 28, 2026 20:20
@tony
tony merged commit 687bd13 into master Nov 28, 2026
9 checks passed
@tony
tony deleted the feat/osc-notifications branch November 28, 2026 20:39
@tony tony mentioned this pull request Nov 28, 2026
21 of 28 tasks

This branch was successfully deployed

1 active deployment
docs — d4d03b3c Deployed Nov 28, 2026 by tony via build (3.14) #122
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.

Emit typed notification events for OSC 9, Kitty OSC 99, and OSC 777

1 participant