{{ message }}
Repository navigation
fix(video): hide the ffmpeg console window on Windows - #43520
Open
Daniel (dmitgush) wants to merge 1 commit into
Open
Daniel (dmitgush) wants to merge 1 commit into
Daniel (dmitgush) wants to merge 1 commit into
Conversation
launchProcess() builds its spawn() options without windowsHide, so on Windows the ffmpeg process started for video recording gets a console window of its own (inherited from the terminal, or newly created when the parent has none - e.g. the CLI session daemon, which has run detached with windowsHide: true since microsoft#42155). One window appears per recording and steals focus. microsoft#41630 asked for windowsHide on every launchProcess call, but that was closed as not planned: an earlier attempt (microsoft#38776) was reverted in microsoft#39994 after it broke Inspector, codegen and UI mode (microsoft#39990), since those processes do have real windows of their own. ffmpeg has none, so make windowsHide an opt-in LaunchProcessOptions field and set it only for the ffmpeg launch in videoRecorder.ts, leaving every other launchProcess call unaffected. Fixes microsoft#43515
Author
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Fixes #43515.
On Windows, the ffmpeg process that Playwright starts for video recording gets a visible console window of its own.
launchProcess()never passedwindowsHidetochild_process.spawn(), so ffmpeg inherits (or creates) a console - since #42155 the CLI session daemon runs detached withwindowsHide: trueand has no console of its own, any console program it starts (ffmpeg) gets a brand new window, which steals focus every time a recording starts.#41630 asked for
windowsHide: trueon everylaunchProcesscall, and was closed as not planned: an earlier attempt at exactly that (#38776) was reverted in #39994 after it broke Inspector, codegen and UI mode (#39990) - those child processes have real windows of their own thatwindowsHidewould also hide.This PR makes
windowsHidean opt-in field onLaunchProcessOptions(default unset, so behavior elsewhere is unchanged) and sets it only for the ffmpeg launch invideoRecorder.ts, since ffmpeg has no GUI and nothing to hide incorrectly.Test plan
windowsHideis a Windows-onlychild_processoption (no-op elsewhere per Node docs), so there's nothing to assert about window visibility in CI on Linux/macOS, and the prior related fix for the same file (fix(windows): hide console window when spawning browser processes #38776) shipped the same way, with manual Windows verification only, no automated test.video.spec.tssuite (31 tests) on macOS with the change - all pass, confirming the new field doesn't change ffmpeg's behavior off Windows.npx eslintandnpx tsc -p .on the changed files - clean.🤖 Generated with Claude Code