fix: honor explicit Windows cmd shell path

Maintainer edit: launch explicit cmd shells as cmd.exe /c so COMSPEC or absolute cmd.exe paths are actually used.
This commit is contained in:
chengyongru
2026-07-06 12:11:25 +08:00
committed by Xubin Ren
parent 4ec111c1a9
commit 8c4a74ee3c
2 changed files with 14 additions and 12 deletions
+2 -2
View File
@@ -491,8 +491,8 @@ class ExecTool(Tool):
program = shell_program or default_program
program_name = PureWindowsPath(program).name.lower()
if program_name in ("cmd", "cmd.exe"):
return await asyncio.create_subprocess_shell(
command,
return await asyncio.create_subprocess_exec(
program, "/c", command,
stdin=stdin,
stdout=asyncio.subprocess.PIPE,
stderr=asyncio.subprocess.PIPE,