fix: suppress console window flashes on Windows via global subprocess patch (#53282) - #53291
Closed
Sahil-SS9 wants to merge 1 commit into
Closed
fix: suppress console window flashes on Windows via global subprocess patch (#53282)#53291Sahil-SS9 wants to merge 1 commit into
Sahil-SS9 wants to merge 1 commit into
Conversation
kaizen-commits
left a comment
There was a problem hiding this comment.
Had Hermes implement this patch.. Can confirm, that’s the best kind of temporary patch: ugly in the right way, quiet in the UI, and easy to verify later.
19 tasks
This was referenced Jun 28, 2026
Contributor
|
Closing as superseded by the consolidated Windows console-flash work tracked in #54220. The relevant pieces from this PR/cluster have now landed through the targeted follow-up PRs #54236, #53892, and #54417, or are recorded in the umbrella tracker for any remaining native-Windows verification. Keeping this separate PR open would duplicate the tracker and the merged follow-up work. Thanks for digging into this — the reports and PRs in this cluster helped identify the remaining spawn legs. |
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.
Fixes #53282
Description
On Windows, every
subprocess.Popenof a.exespawns a visible console window briefly unlessCREATE_NO_WINDOW(0x08000000) is passed increationflags. The codebase has ~300 subprocess call sites; only a handful usewindows_hide_flags().Rather than touching every call site (a large, fragile mechanical diff), this PR adds a global monkeypatch in
hermes_cli/_subprocess_compat.pythat auto-injectsCREATE_NO_WINDOWinto everysubprocess.Popen/run/call/check_output/check_callcall on Windows whencreationflagsis not already provided.Key design decisions:
Popenis replaced with a proper subclass (not a plain function), preservingisinstancechecks and subclassability. Several tests and the process registry subclassPopen; a plain function wrapper would break them.creationflagsfrom callers that set their own (e.g.DETACHED_PROCESSfor daemons) are preserved.hermes_cli/__init__.pyat import time so the patch is active before any tool or gateway code runs.Verification
isinstanceworks, subprocess calls function normally