Repository navigation
fix(linux): bells over SSH no longer muted by tmux or silent terminals - #149
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tions Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…erminal Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.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.
Fixes the two causes traced for #147: on OpenCode 2 over SSH, the terminal bell never rang. The reporter has not replied, so neither cause is confirmed on their machine.
What was broken
suppressWhenFocused(on by default) dropped every bell.index.js/tui.js, not frompackage.jsonexports.How the fix works
SSH_CONNECTIONorSSH_TTYis set and no desktop window was captured, tmux and Zellij pane state no longer counts as focus, so alerts are delivered (AGENTS.md: fail open). Local sessions, and SSH sessions where a desktop window was detected, behave as before. This applies to V1 and V2.minDurationare still checked after the claim, as before, so only the winning terminal runs focus probes and short sessions clear deferred completions as before.The reporter's theory that
process.stdout.isTTYis false in the V2 TUI does not hold. In a sandboxed OpenCode v2.0.32 run it wastrue, and the bell reached the terminal.Surfaces: V1 and V2 for the SSH focus rule; V2 terminal only for the claim change; Linux only (macOS and Windows focus paths unchanged); channels unchanged. README, SPEC and CHANGELOG updated.
Proof
Focused tests, with typecheck clean:
Both new tests fail against main's
notifier.ts,delivery.tsandfocus.ts:Real app: OpenCode v2.0.32 in an isolated temp home with
--standalone, the plugin loaded through the new CONTRIBUTING shim recipe, and the bell enabled forclient_connectedonly. OpenCode loggedloading plugin id=<shim>, and exactly one bare BEL reached the pty.Not tested: a real SSH session from another machine into tmux. To check it yourself, SSH into a Linux box, start tmux, run OpenCode 2 with
bell: trueforcomplete, switch your local terminal to another tab, and let a session finish. Before this change it stays silent; after it, the tab gets the bell. macOS and Windows behavior is untouched.Known gap: a tmux server started locally, then attached over SSH, has no SSH variables in its panes, so it still mutes alerts as before.
Reviewed with review-loop: 4 rounds with GPT-6.1 Terra. Terra verdict: approved
Generated with Claude Code using Claude Opus 5.5