Skip to content

Commit

Permalink
feat: add OSC 9 notifications (#230)
Browse files Browse the repository at this point in the history
* feat: add OSC 9 notifications

Signed-off-by: Carlos Alexandro Becker <[email protected]>

* Update ansi/notification.go

Co-authored-by: Ayman Bagabas <[email protected]>

* Update ansi/notification.go

Co-authored-by: Ayman Bagabas <[email protected]>

---------

Signed-off-by: Carlos Alexandro Becker <[email protected]>
Co-authored-by: Ayman Bagabas <[email protected]>
  • Loading branch information
caarlos0 and aymanbagabas authored Oct 30, 2024
1 parent d8ba93c commit dc6745b
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions ansi/notification.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package ansi

// Notify sends a desktop notification using iTerm's OSC 9.
//
// OSC 9 ; Mc ST
// OSC 9 ; Mc BEL
//
// Where Mc is the notification body.
//
// See: https://iterm2.com/documentation-escape-codes.html
func Notify(s string) string {
return "\x1b]9;" + s + "\x07"
}

0 comments on commit dc6745b

Please sign in to comment.