Skip to content

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

Open

Description

@tony

Summary

For 0.1.0, Terminal._handle_osc() consumes desktop notification sequences (OSC 9 ; <msg> outside 9;4 progress and 9;9 cwd, Kitty OSC 99 ; <meta> ; <payload>, and rxvt-unicode / VTE OSC 777 ; notify ; <title> ; <body>) silently without emitting UnhandledSequence. Typed notification Event dataclasses and Kitty OSC 99 multi-chunk reassembly are deferred to 0.2.0.

Motivation

CLI build tools, test runners, and coding agents emit OSC 9, OSC 777;notify, or Kitty OSC 99 (i=, d=0/1, p=title/body, base64 e=1, query a=query) to notify users when long commands finish. Exposing a unified bounded notification Event lets headless runners and multiplexers assert or forward notifications without parsing raw OSC bytes themselves.

Proposal

Invariants

The invariants below are load-bearing; everything under Intent is open.

  • Notification text fields are sanitized via sanitize_terminal_text(), accounted for by UTF-8 byte length in _event_byte_cost(), and capped by Limits (including bounded chunk reassembly for OSC 99 d=0 continuations).
  • OSC 9;4 progress reporting and OSC 9;9 working-directory updates continue routing to ProgramStatusStore and _update_cwd() without ambiguity.

Intent (non-binding)

  • Target 0.2.0: add a Notification member to the Event union carrying protocol source ("osc9", "osc99", "osc777"), notification_id, title, and body, gated by a Policy flag (allow_notifications: bool = True, capability query reply opt-in).

Not doing

  • Invoking OS desktop notification daemons (libnotify, osascript, WinRT) from libvt.

References

Activity

  1. added
    enhancement
    on Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions