On Windows, opencode-notifier 0.2.6 and newer minimize the current terminal window when OpenCode runs.
Tested environment:
- Windows
- PowerShell 7.6.1
- cmd.exe
- OpenCode 1.16.0
Reproduction:
-
Configure the plugin as:
@mohak34/opencode-notifier@0.2.6
-
Run:
opencode run "hello"
Actual result:
The current PowerShell/cmd window is minimized.
Expected result:
The terminal window should stay visible.
Regression:
- @mohak34/opencode-notifier@0.2.5 works correctly
- @mohak34/opencode-notifier@0.2.6 minimizes the terminal
- @mohak34/opencode-notifier@latest also minimizes the terminal
I compared 0.2.5 and 0.2.6 and found that 0.2.6 added this argument to the internal PowerShell/pwsh call used for Windows focus detection:
-WindowStyle Hidden
After removing "-WindowStyle", "Hidden" from the cached dist/index.js, the terminal no longer minimizes.
So the likely cause is the use of -WindowStyle Hidden when calling PowerShell/pwsh for GetForegroundWindow focus detection.
Current workaround:
Pin the plugin to 0.2.5:
@mohak34/opencode-notifier@0.2.5
On Windows, opencode-notifier 0.2.6 and newer minimize the current terminal window when OpenCode runs.
Tested environment:
Reproduction:
Configure the plugin as:
@mohak34/opencode-notifier@0.2.6
Run:
opencode run "hello"
Actual result:
The current PowerShell/cmd window is minimized.
Expected result:
The terminal window should stay visible.
Regression:
I compared 0.2.5 and 0.2.6 and found that 0.2.6 added this argument to the internal PowerShell/pwsh call used for Windows focus detection:
-WindowStyle Hidden
After removing "-WindowStyle", "Hidden" from the cached dist/index.js, the terminal no longer minimizes.
So the likely cause is the use of -WindowStyle Hidden when calling PowerShell/pwsh for GetForegroundWindow focus detection.
Current workaround:
Pin the plugin to 0.2.5:
@mohak34/opencode-notifier@0.2.5