Repository navigation
fix(wsl): suppress alerts when the Windows Terminal window is focused - #156
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
|
Thanks for this. It's merged and out as I added two commits on top: the WSL window capture now runs in the background so it no longer delays OpenCode startup, and the probe output parser validates its input more strictly. Your logic is unchanged. Could you test it on your WSL + Windows Terminal setup? Set the plugin in { "plugin": ["@mohak34/opencode-notifier@1.3.0-beta.0"] }Then check:
One behavior change to watch for: right after OpenCode starts, alerts are not suppressed for the second or so until the window capture finishes. |
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
Fixes
suppressWhenFocusedwhen running OpenCode inside WSL with Windows Terminal.Related: #155
With
"suppressWhenFocused": true, completion notifications appeared even while the OpenCode terminal window was focused.Notification delivery already recognizes WSL and uses Windows notifications, but focus detection only selects the Windows backend when
process.platform === "win32". Inside WSL, the runtime reportslinux, so it follows the Linux desktop focus path instead.Changes
WT_SESSIONis set.No new configuration option is required. The fix uses the existing
suppressWhenFocusedsetting.Host coverage and limitations
Verification
Tested on WSL2 / Ubuntu 24.04 with Windows Terminal and OpenCode 1.18.35, without tmux, Zellij or WezTerm:
Regression tests cover focused and unfocused windows, ambiguous startup, closed or replaced windows, failed and malformed queries, spawn failures, concurrent queries, asynchronous delivery, SSH, and inactive panes. Existing Linux, KDE and GNOME focus tests also passed.
Live popup behavior was verified on OpenCode 1. OpenCode 2 is covered by shared-code and automated checks but was not manually tested. Native Windows and macOS were not manually tested.
Implemented with OpenAI gpt-6.1-sol via OpenCode.