feat: add Ghostty notification system support#36
Open
LukasdeBoer wants to merge 1 commit intomohak34:mainfrom
Open
feat: add Ghostty notification system support#36LukasdeBoer wants to merge 1 commit intomohak34:mainfrom
LukasdeBoer wants to merge 1 commit intomohak34:mainfrom
Conversation
Add 'ghostty' as a notification system option that uses the OSC 777 escape sequence to send notifications natively through Ghostty terminal. This allows clicking notifications to bring the Ghostty window to the foreground, unlike osascript which opens Script Editor.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
"ghostty"as a newnotificationSystemoption alongside"osascript"and"node-notifier"\e]777;notify;title;body\a) to send notifications natively through Ghostty terminalosascriptwhich opens Script EditorUsage
Set in
~/.config/opencode/opencode-notifier.json:{ "notificationSystem": "ghostty" }Changes
src/config.ts: Added"ghostty"to thenotificationSystemtype union and config parsingsrc/notify.ts: Added Ghostty handler that writes the OSC 777 escape sequence to stdout, with sanitization of control characters (;, BEL, ESC)Testing
Tested locally on macOS with Ghostty — notifications appear as native macOS notifications from Ghostty, and clicking them correctly brings the terminal window to the foreground, even to the correct tab if you have multiple opencodes running simultaneously.