gemini-cli icon indicating copy to clipboard operation
gemini-cli copied to clipboard

feat(cli): add terminal bell notification on response completion

Open afarber opened this issue 2 weeks ago • 8 comments

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:

  1. A response finishes (in the submitQuery finally block)
  2. 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

  1. First check your terminal supports bell: echo -e "\a" (should beep)
  2. Run gemini and submit any query - bell should sound when response completes
  3. Trigger a tool that needs approval (e.g. file edit) - bell should sound when waiting
  4. Set general.terminalBell: false in settings, repeat steps 2-3, no bell should sound
  5. 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

afarber avatar Dec 09 '25 11:12 afarber