Skip to content

fix(cli): hide Windows console for remaining child-process spawns - #3960

Open
lorenzozanee wants to merge 1 commit into
heygen-com:mainfrom
lorenzozanee:restore/pr-3956
Open

lorenzozanee wants to merge 1 commit into
heygen-com:mainfrom
lorenzozanee:restore/pr-3956

Conversation

@lorenzozanee

Copy link
Copy Markdown
Contributor

What

Hide Windows console windows for three remaining child-process spawns in @hyperframes/cli missed by the earlier windowsHide coverage (#3379 in engine, #3529 in cli):

  • telemetry/transport.ts flushSync() — spawns a detached node on every CLI exit to deliver queued events
  • utils/clipboard.ts — where provider probe and the provider copy itself (clip.exe on Windows)
  • server/portUtils.ts windowsListenerPid() — netstat lookup used by preview --list/--stop/conflict logging on Windows

Each site now passes windowsHide: true, a no-op on macOS/Linux. Three regression tests mirror the existing *.windowsHide.test.ts style.

Why

These binaries are console-subsystem on Windows, so spawning them without windowsHide pops a visible console window — including from contexts that own no console (detached preview server, exit-time flush). This closes out the remaining scope of #3500: every spawn/execFile/spawnSync site reachable on Windows in cli, studio-server, lint and engine now carries the flag.

How

One-line option additions only, following the exact pattern already merged in orphanCleanup.ts, manager.ts, preflight.ts, mediaMetadata.ts, waveform.ts, proxyTranscoder.ts, mediaValidation.ts and hevcPreviewLint.ts. No refactor, no new abstraction, no behavior change on non-Windows platforms.

Test plan

  • Unit tests added/updated — 3 new suites (transport, clipboard, portUtils windowsHide tests) fail on base with the flag missing and pass after the fix; existing portUtils.test.ts and all runnable *.windowsHide.test.ts suites pass; oxlint/oxfmt clean; tsc --noEmit shows only pre-existing missing-generated-file errors
  • Manual testing performed — the symptom is Windows-only console flashing; validated via mocked regression tests on Linux (no Windows runner available)
  • Documentation updated (if applicable) — no user-facing behavior or docs change

Closes #3500

Supersedes #3956(原PR分支已删,按原提交重建)

This branch has not been deployed

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

Labels

None yet

Projects

None yet

1 participant