feat(cli): enable notifications cross-platform via terminal bell fallback#21618
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the CLI's notification capabilities by extending them beyond macOS to a truly cross-platform experience. It ensures that users on Windows and Linux can also receive run-event notifications, leveraging either rich OSC 9 notifications where supported or falling back to the terminal bell for broader compatibility. This change makes the notification feature more inclusive and functional across different operating systems. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request successfully enables cross-platform notifications by removing macOS-specific platform checks, allowing the existing terminal bell (BEL) fallback to function on all operating systems. The changes to the core logic, tests, and documentation are correct and well-aligned with this goal. I have one high-severity suggestion regarding a legacy setting that has become misleading as a result of this change. Based on our rules, this setting should be removed entirely rather than deprecated, which will improve configuration clarity and maintainability for users on all platforms.
22a8709 to
a20ce50
Compare
…back Remove the macOS-only restriction from the notification system. The BEL fallback path was already implemented but gated behind a darwin platform check. On terminals that support OSC 9 (iTerm2, WezTerm, Ghostty, Kitty), rich notifications are emitted. On all other terminals (including Windows Terminal), the universal terminal bell is used instead, which typically triggers a taskbar flash or system alert sound. Also fix OSC 9 tests to clear WT_SESSION so they pass when run inside Windows Terminal. Fixes google-gemini#21617
The macOS-specific setting name is misleading now that notifications are cross-platform. Users should use enableNotifications instead.
Head branch was pushed to by a user without write access
a20ce50 to
178c6c8
Compare
Snapshot tests were failing because the notification setting description changed. Also fixes Prettier formatting in docs/cli/settings.md.
|
@Adib234 -- sorry, the PR became unmergeable to main so I rebased, but I think that caused the CI to stall. Could you kick it? |
|
I can kick off the workflow but please address the changes not relevant to the PR |
The trailing newline added to this symlink broke CI — git stores symlinks as text, so the target became "../CONTRIBUTING.md\n" which doesn't resolve.
|
Ah -- didn't realise something touched the CONTRIBUTING.md file. Reverted. |
|
tests failed, could you please fix them? |
|
Will do but am away for the rest of the month... Okay to wait? |
|
@genneth Might be too long, do you mind if we fix it for you and merge? |
|
Of course -- no preciousness here about the PR! |
…bell-notifications # Conflicts: # docs/cli/settings.md
84f1c19
…back (#21618) Co-authored-by: Sandy Tao <sandytao520@icloud.com>
…back (google-gemini#21618) Co-authored-by: Sandy Tao <sandytao520@icloud.com>
…back (google-gemini#21618) Co-authored-by: Sandy Tao <sandytao520@icloud.com>
…back (google-gemini#21618) Co-authored-by: Sandy Tao <sandytao520@icloud.com>
Summary
process.platform === 'darwin') restriction from the notification systemDetails
The notification system had two
darwingates:isNotificationsEnabled()— prevented the setting from being active on non-macOSnotifyViaTerminal()— early-returned on non-macOS even if calledMeanwhile,
emitOsc9Notification()already had a working BEL fallback for terminals without OSC 9 support, andsupportsOsc9Notifications()already correctly returnedfalsefor Windows Terminal (via theWT_SESSIONenv var check). Removing the platform restriction lets the existing fallback path work cross-platform.Also fixes two OSC 9 tests that failed when run inside Windows Terminal because
WT_SESSIONwas set in the environment, causingsupportsOsc9Notifications()to returnfalseregardless of the stubbedTERM_PROGRAM.Related Issues
Fixes #21617
How to Validate
general.enableNotifications: trueinsettings.jsonPre-Merge Checklist