diff --git a/lib/coreBundle.js b/lib/coreBundle.js index d9041dd0f009072511a7d808dec83121ff29e127..e5c72c452c98f1c64038c5f24ac5805fbc99151f 100644 --- a/lib/coreBundle.js +++ b/lib/coreBundle.js @@ -8906,6 +8906,10 @@ async function launchProcess(options) { env: options.env, cwd: options.cwd, shell: options.shell, + // gstack patch (#2160/#1989): Node defaults windowsHide to false for + // child_process.spawn, so browser children could flash a console window + // on Windows. Playwright never needs the child's window shown. + windowsHide: true, stdio }; const spawnedProcess = childProcess.spawn(options.command, options.args || [], spawnOptions); @@ -8985,7 +8989,7 @@ async function launchProcess(options) { options.log(`[pid=${spawnedProcess.pid}] `); try { if (process.platform === "win32") { - const taskkillProcess = childProcess.spawnSync(`taskkill /pid ${spawnedProcess.pid} /T /F`, { shell: true }); + const taskkillProcess = childProcess.spawnSync(`taskkill /pid ${spawnedProcess.pid} /T /F`, { shell: true, windowsHide: true }); const [stdout2, stderr2] = [taskkillProcess.stdout.toString(), taskkillProcess.stderr.toString()]; if (stdout2) options.log(`[pid=${spawnedProcess.pid}] taskkill stdout: ${stdout2}`);