Add Ghostty desktop notification support (OSC 9/99)
Problem
Claude Code's "waiting for input" notifications don't work in Ghostty. They work in iTerm2 without any configuration because Claude Code detects TERM_PROGRAM=iTerm.app and uses iTerm2's proprietary OSC notification protocol. Ghostty isn't matched to any notification backend, so notifications silently do nothing.
Setting preferredNotifChannel = terminal_bell sends a BEL character, but Ghostty doesn't convert BEL into desktop notifications (unlike iTerm2's "Post notifications on bell" feature), so that doesn't help either.
Proposed solution
Ghostty supports OSC 9 (desktop notifications) and has a desktop-notifications = true config option that enables them. Claude Code should detect TERM_PROGRAM=ghostty and use OSC 9 to send notifications. OSC 99 (which Ghostty also supports) is another option.
This would make notifications work out of the box for Ghostty users, the same way they already do for iTerm2 and Kitty users.
Environment
- Claude Code v2.1.87
- Ghostty with
desktop-notifications = true - macOS
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗