diff --git a/aider/utils.py b/aider/utils.py index fa71b6b9f..169dddb38 100644 --- a/aider/utils.py +++ b/aider/utils.py @@ -29,8 +29,15 @@ def run_interactive_command(command): return b try: - # Spawn the command - child = pexpect.spawn(command, encoding="utf-8") + # Check if /bin/sh exists + if os.path.exists('/bin/sh'): + # Use /bin/sh -c if it exists + spawn_command = ['/bin/sh', '-c', command] + child = pexpect.spawn('/bin/sh', args=['-c', command], encoding="utf-8") + else: + # Fall back to the original behavior + spawn_command = command + child = pexpect.spawn(command, encoding="utf-8") # Transfer control to the user, capturing output child.interact(output_filter=output_callback)