Repository navigation
fix(browse): suppress remaining Windows console-window flashes (Chromium headless shell + daemon/agent spawns) - #1998
KrunchMuffin wants to merge 1 commit into
Conversation
On Windows the browse tool pops console windows during normal use. garrytan#1979 fixes one source (the watchdog's tasklist → conhost flash every 60s). This addresses the other three: - chrome-headless-shell.exe (every browse action): the default headless path launches the console-subsystem headless shell, which pops a window. Force Chrome's "new" headless (full chrome.exe, GUI-subsystem → no console window) on Windows via --headless=new. Other platforms keep the lighter shell. - node daemon (detached spawn on Windows): detached spawns create a console window unless windowsHide is set. Added it to the launcher + the detached server spawn. - bun terminal-agent: spawned via Bun.spawn, whose windowsHide does not reliably suppress the window on Windows. Switched to Node's child_process .spawn with windowsHide (reliable), same unref'd lifecycle. Verified on Win11: no chrome-headless-shell process (chrome.exe --headless=new in the cmdline), screenshots render correctly, single daemon, no stray bun windows.
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
|
Cross-link: #1983 ("fix browse lifecycle on Windows") independently makes the same two This PR is the more focused console-flash fix — it also adds |
|
@16francej Please close this because it combines duplicate launcher edits with untested browser-mode and terminal-agent changes; focused rewrites cover the useful parts. |
|
Thanks for chasing the console flashes. Superseded: main now sets |
Problem
On Windows, the
browsetool pops console windows during normal use (issue #1952). #1979 fixes one source — the watchdog'stasklistcall flashing aconhost.exewindow every 60s. This PR addresses the other three sources, which complement that fix.Sources fixed
chrome-headless-shell.exe(every browse action)--headless=newon Windows → fullchrome.exe(GUI-subsystem, no console window). Other platforms keep the lighter shell.detached: trueon Windows creates a console window unlesswindowsHideis set.windowsHide: trueon the launcher + the detached server spawn.bunterminal-agentBun.spawn, whosewindowsHidedoes not reliably suppress the window on Windows.child_process.spawnwithwindowsHide: true(reliable), same unref'd lifecycle.Changes
browse/src/browser-manager.ts—--headless=newon Windows inlaunch().browse/src/cli.ts—windowsHideon the Windows daemon spawn.browse/src/terminal-agent-control.ts— Node spawn +windowsHidefor the terminal-agent.Source-only;
browse/distis gitignored.Verification (Windows 11)
chrome.exe ... --headless=new, nochrome-headless-shell.exe.bun/conhostwindows during normal browsing.Notes
error-handling.ts'stasklist; this one touches the three above).Bun.spawn→node:child_processswap for the terminal-agent is the same lesson fix(browse): stop isProcessAlive from flashing a Windows console every watchdog tick #1979 applied: don't rely on Bun's Windows console handling.