docs: propose terminal-owned macOS notifications - #4739
Open
anujb-msft wants to merge 1 commit into
Open
Conversation
Add an original MIT-licensed example and portable regression coverage for terminal-owned notifications. Document the click-to-focus problem, integration requirements, and platform limitations without including Copilot runtime code or local installation data. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The standalone proposal is internally consistent, safely scoped, and thoroughly tested.
Pull request overview
Adds a standalone reference implementation for terminal-owned macOS notifications without modifying the shipped CLI.
Changes:
- Implements sanitized OSC 777 and OSC 9 notifications.
- Adds 33 portable regression tests.
- Documents integration constraints, tradeoffs, and scoped licensing.
File summaries
| File | Description |
|---|---|
terminal-notifications.mjs |
Implements terminal detection, encoding, and delivery. |
terminal-notifications.test.mjs |
Tests supported, unsupported, and failure scenarios. |
README.md |
Documents the proposal and integration guidance. |
LICENSE |
Applies MIT licensing to the example. |
Review details
- Files reviewed: 4/4 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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
Document the macOS notification click problem and add an original, MIT-licensed
terminal notification example with portable regression tests.
This is a reference proposal, not a change to the shipped CLI. This public
repository does not expose the application implementation; maintainers would
need to integrate the backend into the product.
Problem and proposed behavior
With the unmodified 1.0.84-1 release in Ghostty, clicking a desktop notification
can open Script Editor instead of returning to the terminal. The AppleScript
notification path attributes the notification to the scripting host.
The example uses terminal-owned notifications on supported local macOS TTYs:
OSC 777 for Ghostty and OSC 9 for iTerm2. It sanitizes control characters and
field separators, avoids redirected output, awaits write completion, and reports
unsupported contexts or write failures so the caller can retain native fallback.
The proposal preserves existing notification settings, focus gating,
deduplication, rate limits, and protocol-aware multiplexer routing. It documents
permission and notification-feature tradeoffs rather than claiming identical
native behavior.
Validation
All 33 included tests pass. They run without launching Copilot, reading user
configuration, loading its runtime, or sending desktop notifications.
A separate desktop acceptance run using this backend confirmed that the default
notification click action brought Ghostty to the foreground without opening
Script Editor. That run covered a single Ghostty window; iTerm2 and
multiple-window acceptance remain outside that result.
Submission scope
The four added files contain only the original example, its tests, a scoped MIT
license, and the proposal. No bundled or reconstructed Copilot source, binaries,
runtime-patching tools, user configuration, machine paths, session identifiers,
or private build metadata are included. The repository's existing license is
unchanged.