fix(exec): detach stdin for shell commands

This commit is contained in:
Xubin Ren
2026-05-20 12:07:17 +08:00
parent 38a5f09f02
commit 3eebe08dba
2 changed files with 9 additions and 0 deletions
+2
View File
@@ -266,6 +266,7 @@ class ExecTool(Tool):
# the raw command string to COMSPEC without re-quoting.
return await asyncio.create_subprocess_shell(
command,
stdin=asyncio.subprocess.DEVNULL,
stdout=asyncio.subprocess.PIPE,
stderr=asyncio.subprocess.PIPE,
cwd=cwd,
@@ -274,6 +275,7 @@ class ExecTool(Tool):
bash = shutil.which("bash") or "/bin/bash"
return await asyncio.create_subprocess_exec(
bash, "-l", "-c", command,
stdin=asyncio.subprocess.DEVNULL,
stdout=asyncio.subprocess.PIPE,
stderr=asyncio.subprocess.PIPE,
cwd=cwd,