fix(exec): stabilize Windows shell tests

This commit is contained in:
Xubin Ren
2026-05-21 16:10:09 +08:00
parent ccbc0bb6e3
commit 835bab5f5a
2 changed files with 6 additions and 2 deletions
+2 -1
View File
@@ -414,7 +414,8 @@ class ExecTool(Tool):
)
shell_program = shell_program or shutil.which("bash") or "/bin/bash"
args = [shell_program]
if login and Path(shell_program).name in {"bash", "zsh"}:
shell_name = Path(shell_program).name.lower()
if login and shell_name in {"bash", "bash.exe", "zsh", "zsh.exe"}:
args.append("-l")
args.extend(["-c", command])
return await asyncio.create_subprocess_exec(