Skip to content

[BUG] session daemon opens a console window on Windows #42152

Closed

Description

What's going on?

On Windows every CLI session opens an empty console window next to the browser. I expected only the browser window.

`playwright-cli -s=mysession open https://example.com`

The window stays until the session is closed, and there is one per session name rather than one per command, so it looks like the daemon rather than the individual calls.

cli-client/session.ts spawns the daemon detached without windowsHide: true. node.exe is console-subsystem, so Windows hands it a console; on Linux detached is just setsid and nothing shows. Same in cli-client/program.ts and backend/devtools.ts.

There is history on this flag, but on a different spawn: processLauncher.ts got windowsHide in #38776 and it was reverted in #39994 because it also hid the Inspector and UI mode. That cannot happen here, since these spawns only start background daemons and none of them is a window a user is meant to see.

Happy to send a PR. Windows 11, Node 24, Chrome channel.

Version

@playwright/cli 0.1.18

Activity

  1. Skn0tt commented on Aug 6, 2026

    @Skn0tt
    Contributor

    I can reproduce this under cmd.exe but not under PowerShell. Just to double-check, I assume you also use CMD?

  2. bschaeublin commented on Aug 7, 2026

    @bschaeublin
    Author

    Simon Knott (@Skn0tt) Sorry for the late response - yes the call came from a cmd.exe-rooted environment. I retested again and with powershell the problem also occurred but only on close, which seems also to be closed by your pr in #42155 - thanks for the immediate fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions