diff --git a/frontends/tuiapp_v2.py b/frontends/tuiapp_v2.py index 60a3be7df..90354c386 100644 --- a/frontends/tuiapp_v2.py +++ b/frontends/tuiapp_v2.py @@ -1461,7 +1461,8 @@ def _sweep_stale_task_dirs() -> None: def _clipboard_run(cmd: list[str], input: bytes | None = None, timeout: float = 3.0) -> bytes | None: try: - r = subprocess.run(cmd, input=input, capture_output=True, timeout=timeout) + stdin = subprocess.DEVNULL if input is None else None + r = subprocess.run(cmd, input=input, stdin=stdin, capture_output=True, timeout=timeout) return r.stdout if r.returncode == 0 else None except (FileNotFoundError, subprocess.TimeoutExpired, OSError): return None @@ -5913,7 +5914,7 @@ def _run_shell(self, cmd: str) -> None: out = ''; rc = 0 try: r = subprocess.run( - shell_argv + [cmd], capture_output=True, + shell_argv + [cmd], stdin=subprocess.DEVNULL, capture_output=True, timeout=30, encoding='utf-8', errors='replace', ) out = (r.stdout or '') + (r.stderr or '') diff --git a/ga.py b/ga.py index d2b25aef4..37087570f 100644 --- a/ga.py +++ b/ga.py @@ -56,7 +56,8 @@ def stream_reader(proc, logs): try: process = subprocess.Popen( - cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, + cmd, stdin=subprocess.DEVNULL, + stdout=subprocess.PIPE, stderr=subprocess.STDOUT, bufsize=0, cwd=cwd, startupinfo=startupinfo, creationflags=0x08000000 if os.name == 'nt' else 0 ) diff --git a/memory/checklist_helper.py b/memory/checklist_helper.py index 19706dc17..d169c42ff 100644 --- a/memory/checklist_helper.py +++ b/memory/checklist_helper.py @@ -4,7 +4,7 @@ _R = Path(__file__).resolve().parent.parent _BBS, _MAIN = _R/"assets/agent_bbs.py", _R/"agentmain.py" _W_RE, _M_RE = _R/"reflect/agent_team_worker.py", _R/"reflect/checklist_master.py" -_PK = {"stdout": subprocess.DEVNULL, "stderr": subprocess.DEVNULL} +_PK = {"stdin": subprocess.DEVNULL, "stdout": subprocess.DEVNULL, "stderr": subprocess.DEVNULL} if sys.platform == "win32": _PK["creationflags"] = 0x200 class CL: