Skip to content

Commit 6dc41c1

Browse files
committed
fix(_ipc): suppress empty python.exe console window on Windows daemon spawn
DETACHED_PROCESS overrides CREATE_NO_WINDOW per Win32 docs, so combining them caused Windows to allocate a fresh console for the daemon. Closing that window killed the daemon and forced Chrome to re-prompt for remote debugging permission. Drop DETACHED_PROCESS, keep CREATE_NEW_PROCESS_GROUP for terminal-close survival.
1 parent 82ef2a1 commit 6dc41c1

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/browser_harness/_ipc.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,12 @@ def sock_addr(name): # display-only, used in log lines
3131

3232
def spawn_kwargs(): # subprocess.Popen flags so the daemon detaches from this terminal
3333
if IS_WINDOWS:
34-
return {"creationflags": subprocess.DETACHED_PROCESS | subprocess.CREATE_NEW_PROCESS_GROUP}
34+
# CREATE_NO_WINDOW: no console window for the daemon. CREATE_NEW_PROCESS_GROUP:
35+
# daemon doesn't receive Ctrl-C/Ctrl-Break sent to the parent terminal, so
36+
# closing that terminal doesn't kill it. DETACHED_PROCESS is intentionally
37+
# omitted: per Win32 docs it overrides CREATE_NO_WINDOW, causing Windows to
38+
# allocate a fresh console for the (still console-subsystem) python.exe.
39+
return {"creationflags": subprocess.CREATE_NEW_PROCESS_GROUP | subprocess.CREATE_NO_WINDOW}
3540
return {"start_new_session": True}
3641

3742

0 commit comments

Comments
 (0)