Commit 052c7fe
fix(browse): stop the Bun polyfill flashing console windows on Windows
The Node bun-polyfill forwards Bun.spawn/spawnSync to child_process
without windowsHide. Node defaults that option to false, so on Windows
every child the browse server starts opens a console window -- Bun
itself does not behave this way, so the polyfill was drifting from the
API it emulates.
The visible symptom is an empty black bun.exe window appearing every
~60s: server.ts's agent watchdog respawns a crashed terminal-agent on
each tick, and the agent is spawned with stdio ['ignore','ignore',
'ignore'], so the window it opens has nothing in it. The tasklist,
powershell and chrome --version helpers pop windows the same way.
Fixed at the polyfill rather than the call sites, since it is the one
choke point every Bun.spawn under Node passes through. An explicit
windowsHide: false is still honoured for callers that want a visible
console.
Verified against the unpatched polyfill (spawn/spawnSync both received
undefined) and the patched one (both receive true, explicit false still
wins).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent a325940 commit 052c7fe
2 files changed
Lines changed: 46 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
78 | 82 | | |
79 | 83 | | |
80 | 84 | | |
| |||
91 | 95 | | |
92 | 96 | | |
93 | 97 | | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
94 | 102 | | |
95 | 103 | | |
96 | 104 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
51 | 89 | | |
52 | 90 | | |
53 | 91 | | |
| |||
0 commit comments