Skip to main content

Module notifications

Module notifications 

Source
Expand description

Terminal desktop-notification protocols (grok-build parity).

Different terminals accept desktop notifications through different OSC escape sequences. This module picks the best one the host terminal supports and wraps it for tmux passthrough when needed.

ProtocolTerminalsSequence
OSC 9iTerm2, WezTerm, WarpESC ] 9 ; <msg> BEL
OSC 99Kitty, GhosttyESC ] 99 ; i=<id> ; <msg> BEL
OSC 777rxvt-unicode, foot, VTEESC ] 777 ; notify ; <title> ; <msg> BEL
BELfallbackBEL

Enums§

NotificationProtocol
The notification protocol a terminal understands.

Functions§

detect_protocol
Detect the protocol from the live environment.
detect_protocol_from
Decide the best protocol from environment signals. Pure (no I/O) so it can be unit-tested against synthetic env values.
emit_notification
Emit a desktop notification to stderr using the best detected protocol, wrapping for tmux passthrough when TMUX is set.
osc8_file_link
Wrap a local file path as a file:// OSC 8 hyperlink.
osc8_hyperlink
Wrap text in an OSC 8 hyperlink escape pointing to url.
render_sequence
Build the raw escape sequence for protocol carrying title/message.
tmux_wrap
Wrap an escape sequence for tmux passthrough: every ESC (0x1b) is doubled and the whole thing is framed with DCS tmux ; … ST.