From 214b95392bb7f19c3a3886168d4936916de424ae Mon Sep 17 00:00:00 2001 From: LifeJiggy <192385615+LifeJiggy@users.noreply.github.com> Date: Mon, 18 May 2026 19:34:10 -0700 Subject: [PATCH] fix(process-registry): detach stdin from background subprocesses to prevent keyboard freeze Background process non-PTY path used stdin=subprocess.PIPE unconditionally, creating an orphan pipe that was never written to and never closed. Child processes that read stdin would block indefinitely, competing with the parent's prompt_toolkit event loop for terminal ownership and causing complete keyboard lockout. Change to stdin=subprocess.DEVNULL so children get immediate EOF on stdin reads instead of blocking forever. For interactive stdin, the PTY path (which has its own independent PTY via ptyprocess.PtyProcess.spawn) should be used instead. Fixes #17959 --- tools/process_registry.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/process_registry.py b/tools/process_registry.py index 8429a71e08..4ffa9923af 100644 --- a/tools/process_registry.py +++ b/tools/process_registry.py @@ -555,7 +555,7 @@ class ProcessRegistry: errors="replace", stdout=subprocess.PIPE, stderr=subprocess.STDOUT, - stdin=subprocess.PIPE, + stdin=subprocess.DEVNULL, preexec_fn=None if _IS_WINDOWS else os.setsid, creationflags=subprocess.CREATE_NO_WINDOW if _IS_WINDOWS else 0, )