fix(windows): hide local subprocess consoles

Apply Windows CREATE_NO_WINDOW flags to foreground local terminal subprocesses and tracked background processes so Hermes operations do not flash or steal focus with extra console windows.
This commit is contained in:
nekwo
2026-05-16 13:22:52 -04:00
committed by Teknium
parent f007ef8ab5
commit 95683c0283
2 changed files with 8 additions and 1 deletions

View File

@@ -12,6 +12,7 @@ import time
from pathlib import Path
from tools.environments.base import BaseEnvironment, _pipe_stdin
from hermes_cli._subprocess_compat import windows_hide_flags
_IS_WINDOWS = platform.system() == "Windows"
@@ -519,6 +520,8 @@ class LocalEnvironment(BaseEnvironment):
_popen_cwd = self.cwd
_popen_kwargs = {"creationflags": windows_hide_flags()} if _IS_WINDOWS else {}
proc = subprocess.Popen(
args,
text=True,
@@ -531,6 +534,7 @@ class LocalEnvironment(BaseEnvironment):
preexec_fn=None if _IS_WINDOWS else os.setsid,
creationflags=subprocess.CREATE_NO_WINDOW if _IS_WINDOWS else 0,
cwd=_popen_cwd,
**_popen_kwargs,
)
if not _IS_WINDOWS:
try: