From da9da7936ccb0ccf53c76ab455814c9ee100d7e7 Mon Sep 17 00:00:00 2001 From: Dominik Jain Date: Wed, 10 Sep 2025 11:48:33 +0200 Subject: [PATCH] Enable use of shell also for Windows in execute_shell_command This is really required, as many commands must be interpreted by the shell (e.g. execution of batch files/other executables without specifying the extension, etc.) For example, npm typically cannot just be run as npm otherwise --- src/serena/util/shell.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/serena/util/shell.py b/src/serena/util/shell.py index 997a28f4..3b310852 100644 --- a/src/serena/util/shell.py +++ b/src/serena/util/shell.py @@ -1,5 +1,4 @@ import os -import platform import subprocess from pydantic import BaseModel @@ -26,10 +25,9 @@ def execute_shell_command(command: str, cwd: str | None = None, capture_stderr: if cwd is None: cwd = os.getcwd() - is_windows = platform.system() == "Windows" process = subprocess.Popen( command, - shell=not is_windows, + shell=True, stdin=subprocess.DEVNULL, stdout=subprocess.PIPE, stderr=subprocess.PIPE if capture_stderr else None,