You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Windows console window pops up when launching chrome-headless-shell (processLauncher missing windowsHide) #41630
On Windows, launching Chromium opens a console window (a Windows Terminal window on Win11) for chrome-headless-shell.exe. The browser process is spawned without windowsHide, so chrome-headless-shell (a console-subsystem binary) gets a console window.
Root cause
src/server/utils/processLauncher.js builds spawnOptions with detached but never windowsHide:
Patched processLauncher.js in node_modules locally, restarted — the chrome-headless-shell console window no longer appears (confirmed via EnumWindows). Windows-only; no-op elsewhere.
This was actually fixed in #38776 but had to be reverted (#39994) because windowsHide: true was added unconditionally to launchProcess(), and that ended up hiding Inspector and codegen windows too since they go through the same path.
I think the fix here is to make it opt-in so only headless launches get it. Will put up a PR.
On Windows, launching Chromium opens a console window (a Windows Terminal window on Win11) for chrome-headless-shell.exe. The browser process is spawned without windowsHide, so chrome-headless-shell (a console-subsystem binary) gets a console window.
On Windows, launching Chromium opens a console window (a Windows Terminal window on Win11) for chrome-headless-shell.exe. The browser process is spawned without windowsHide, so chrome-headless-shell (a console-subsystem binary) gets a console window.
Can't reproduce this. Please share exact steps.
#40741 might be worth a look since it covers the same underlying thing.
We tried hard reproducing this issue, but were not able to. This seems very specific to your setup. Without a repro, we are not going to risk breaking users, sorry.
Dmitry Gozman (@dgozman) did you try reproducing with #40741 (comment)? This is similar to when other tools wrap Playwright e.g. coding agents and then it ends up in a similar issue.
Thank you all for the comments and attempts to reproduce! For context, I use playwright-cli through gstack and it happened a lot. I also had to make some changes there which I opened a PR for (garrytan/gstack#2182 (comment)). I tried only the changes there without the playwright-cli changes and it seems to still happen so the change here might be important for it all to work.
Possibly relevant, though I'm not sure it's the same thing this issue describes.
#42152 reported a console window from a different spawn site (the CLI session daemon) and was fixed in #42155, which also happened to touch the taskkill spawn inside launchProcess:
That taskkill one is what I ran into on Windows 11 with @playwright/cli 0.1.18. The visible window belongs to cmd.exe /d /s /c "taskkill /pid <browser> /T /F", spawned by the detached cliDaemon.js. Adding windowsHide to that single line makes it go away and reverting it brings it back. One thing that tripped me up while checking: counting processes doesn't show any difference, since CREATE_NO_WINDOW still allocates a conhost, just an invisible one. I had to poll EnumWindows + IsWindowVisible before the change was visible at all.
Whether that shares a root cause with the chrome-headless-shell window reported here, I genuinely can't say — my setup launches chrome.exe, so I never touch the browser spawn path. The only thing that looks common across the reports is a parent process with no console to inherit. #40741 described that setup, but it was closed before the recipe got tried here. If that really is the precondition, it might be why it doesn't show up when running from a normal terminal.
Not asking for the decision to be revisited, just leaving the cross-link — #42155 isn't mentioned anywhere on this issue.
Activity
triemerge commentedon Jul 6, 2026
This was actually fixed in #38776 but had to be reverted (#39994) because
windowsHide: truewas added unconditionally tolaunchProcess(), and that ended up hiding Inspector and codegen windows too since they go through the same path.I think the fix here is to make it opt-in so only headless launches get it. Will put up a PR.
pavelfeldman commentedon Jul 6, 2026
Can't reproduce this. Please share exact steps.
triemerge commentedon Jul 6, 2026
#40741 might be worth a look since it covers the same underlying thing.
dgozman commentedon Jul 14, 2026
We tried hard reproducing this issue, but were not able to. This seems very specific to your setup. Without a repro, we are not going to risk breaking users, sorry.
mxschmitt commentedon Jul 14, 2026
Dmitry Gozman (@dgozman) did you try reproducing with #40741 (comment)? This is similar to when other tools wrap Playwright e.g. coding agents and then it ends up in a similar issue.
Vistritium commentedon Jul 14, 2026
I don't have complicated setup, I use playwright-cli with codex and it happens all the time when codex is using playwright-cli.
tomfluff commentedon Jul 17, 2026
Thank you all for the comments and attempts to reproduce! For context, I use playwright-cli through gstack and it happened a lot. I also had to make some changes there which I opened a PR for (garrytan/gstack#2182 (comment)). I tried only the changes there without the playwright-cli changes and it seems to still happen so the change here might be important for it all to work.
vinhch commentedon Aug 7, 2026
Possibly relevant, though I'm not sure it's the same thing this issue describes.
#42152 reported a console window from a different spawn site (the CLI session daemon) and was fixed in #42155, which also happened to touch the
taskkillspawn insidelaunchProcess:That taskkill one is what I ran into on Windows 11 with @playwright/cli 0.1.18. The visible window belongs to
cmd.exe /d /s /c "taskkill /pid <browser> /T /F", spawned by the detachedcliDaemon.js. AddingwindowsHideto that single line makes it go away and reverting it brings it back. One thing that tripped me up while checking: counting processes doesn't show any difference, sinceCREATE_NO_WINDOWstill allocates a conhost, just an invisible one. I had to pollEnumWindows+IsWindowVisiblebefore the change was visible at all.Whether that shares a root cause with the
chrome-headless-shellwindow reported here, I genuinely can't say — my setup launcheschrome.exe, so I never touch the browser spawn path. The only thing that looks common across the reports is a parent process with no console to inherit. #40741 described that setup, but it was closed before the recipe got tried here. If that really is the precondition, it might be why it doesn't show up when running from a normal terminal.Not asking for the decision to be revisited, just leaving the cross-link — #42155 isn't mentioned anywhere on this issue.