macOS: Suppress desktop notifications (OSC 9) when terminal surface is focused #10691
Unanswered
dandaka
asked this question in
Feature Requests, Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Problem
When a program running in Ghostty sends an OSC 9 desktop notification while the Ghostty window is already focused and actively in use, macOS still displays a notification banner and sets the dock badge. This is disruptive — if I'm already looking at the terminal, there's no reason to notify me.
A common scenario: tools like Claude Code use hooks that emit OSC 9 notifications when waiting for user confirmation. When I'm actively working in the terminal, I see every prompt appear in real-time — the macOS notification banner on top of that is redundant and distracting.
Current Behavior
PR #7531 improved things by auto-dismissing notifications after 3 seconds when the surface is focused. But the notification still:
Proposed Behavior
When the terminal surface that emits the notification is focused, do not create the macOS notification at all. The user is already looking at the output — they don't need a separate alert.
Optionally, this could be controlled via a config option like:
Where values could be:
true— always show (current default)unfocused-only— only show when the surface is not focused (proposed default or opt-in)false— never show (existing option)Environment
This discussion was co-authored with Claude Code.
All reactions