gemini-cli
gemini-cli copied to clipboard
feat(cli): add terminal bell notification on response completion
Summary
Adds an optional terminal bell notification (\x07) that plays when:
- A response completes
- The system awaits tool approval
The general.terminalBell setting is enabled by default and can be disabled in settings. Only triggers in TTY environments.
Details
Writes \x07 (BEL character) to stderr when:
- A response finishes (in the submitQuery finally block)
- Waiting for tool approval (streamingState becomes WaitingForConfirmation)
Uses Ink's useStdout() hook rather than process.stdout to bypass patchStdio() which redirects stdout writes to event emitters.
Users who find it annoying can disable with general.terminalBell: false in settings.
Related Issues
Closes #14643 Partially fixes #14696
How to Validate
- First check your terminal supports bell: echo -e "\a" (should beep)
- Run gemini and submit any query - bell should sound when response completes
- Trigger a tool that needs approval (e.g. file edit) - bell should sound when waiting
- Set general.terminalBell: false in settings, repeat steps 2-3, no bell should sound
- Pipe output somewhere (gemini --help | cat) - no bell (TTY check)
Pre-Merge Checklist
- [ ] Updated relevant documentation and README (if needed)
- [x] Added/updated tests (if needed)
- [ ] Noted breaking changes (if any)
- [x] Validated on required platforms/methods:
- [x] MacOS
- [x] npm run
- [ ] npx
- [ ] Docker
- [ ] Podman
- [ ] Seatbelt
- [ ] Windows
- [ ] npm run
- [ ] npx
- [ ] Docker
- [x] Linux
- [x] npm run
- [ ] npx
- [ ] Docker
- [x] MacOS