fix: ring terminal bell properly inside TUI by writing to /dev/tty#102
Merged
fix: ring terminal bell properly inside TUI by writing to /dev/tty#102
Conversation
The terminal bell was not ringing inside the tasks TUI app when a task
moved to blocked state. This was because fmt.Print("\a") writes to
stdout which gets captured by Bubble Tea's alternate screen buffer.
Fixed by creating a RingBell() function that writes directly to /dev/tty
to bypass the TUI's output handling. This ensures the bell reaches the
actual terminal regardless of what the TUI framework is doing with stdout.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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
RingBell()utility function that writes the BEL character (\a) directly to/dev/ttyfmt.Print("\a")Problem
When a task moved to "blocked" state (needing user input), the terminal bell was working in iTerm but not inside the tasks TUI app. This was because
fmt.Print("\a")writes to stdout, which gets captured by Bubble Tea's output handling.Solution
By writing directly to
/dev/tty, we bypass any stdout buffering or capture that the TUI framework might be doing. Falls back to stderr if/dev/ttyis unavailable.Test plan
🤖 Generated with Claude Code