Windows: cmd window flashes every 20s due to missing windowsHide in detectWindows()
Problem
On Windows, the happy daemon causes a cmd.exe window to flash every 20 seconds. This interrupts typing and steals focus.
Root Cause
detectWindows() in types-CeXKAJ1l.cjs:2310 runs powershell Get-Command via execSync without windowsHide: true:
child_process.execSync(
`powershell -NoProfile -Command "Get-Command ${name} -ErrorAction SilentlyContinue"`,
{ stdio: "ignore" } // missing windowsHide: true
);
This is called from startKeepAlive() every 20 seconds (2e4 ms interval), checking for claude, codex, gemini, and openclaw — spawning 4 cmd.exe windows each time.
Fix
Add windowsHide: true to the execSync options:
child_process.execSync(
`powershell -NoProfile -Command "Get-Command ${name} -ErrorAction SilentlyContinue"`,
{ stdio: "ignore", windowsHide: true }
);
Note: the codebase already uses windowsHide: true in other places (e.g., AcpBackend spawn).
Environment
- Windows 11 Pro
- Happy CLI v1.1.3
- Node.js v22.13.0
TT
This problem is extremely serious and has not been fixed, resulting in it being completely unusable now
@Scoteezy can you take a look at this after the background bug?
This should be fixed by #950 which added windowsHide: true to all spawn/execSync calls, including detectWindows(). Tested on my end and the flashing is gone. Let me know if it still reproduces for you.
This should be fixed by #950 which added
windowsHide: trueto allspawn/execSynccalls, includingdetectWindows().Tested on my end and the flashing is gone. Let me know if it still reproduces for you.这应该通过 #950 被修复,它在所有spawn/execSync调用中添加了windowsHide: true,包括detectWindows().我在自己的机器上进行了测试,闪光消失了。如果它仍然可以重现,请告诉我。
The problem still persists. I am using the latest version, which was installed via npm install. Later, I referred to some solutions in the issue and, with the help of AI, fixed the problem locally by adding windowsHide: true to all spawn/execSync calls. Below is the AI's summary of the fix:
To maintain consistency and prevent mismatched entry paths in the future, the corresponding CommonJS bundled files have been updated synchronously:
dist/index-CFDuT2lI.cjsdist/config-By3tJsda.cjsdist/runCodex-Hj1gDCqd.cjsdist/runOpenClaw-D7GKr0GN.cjs
The same windowsHide: true configuration has been added to the corresponding execSync, execFileSync, and spawn(...) call locations in the above files.
fixed — added windowsHide: true to all spawn/exec calls across the codebase (PRs #950, #951, #1022). no more cmd.exe popups. npm i -g happy