Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions core/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,14 +294,26 @@ def _build_command(command: str, executor_type: str) -> list[str] | None:
if executor_type == "cmd":
if system == "windows":
return ["cmd.exe", "/c", command]
# Fall back to sh on non-Windows
return ["sh", "-c", command]
# Fall back to direct execution on non-Windows (avoid shell -c)
try:
argv = shlex.split(command, posix=True)
except ValueError:
return None
return argv or None

if executor_type == "bash":
return ["bash", "-c", command]
try:
argv = shlex.split(command, posix=True)
except ValueError:
return None
return argv or None

if executor_type == "sh":
return ["sh", "-c", command]
try:
argv = shlex.split(command, posix=True)
except ValueError:
return None
return argv or None

return None

Expand Down
Loading