diff --git a/aider/run_cmd.py b/aider/run_cmd.py index 003727ea1..910b67005 100644 --- a/aider/run_cmd.py +++ b/aider/run_cmd.py @@ -9,13 +9,10 @@ import pexpect def run_cmd(command): import sys - if not sys.stdin.isatty(): - return run_cmd_subprocess(command) + if sys.stdin.isatty() and hasattr(pexpect, "spawn"): + return run_cmd_pexpect(command) - if hasattr(pexpect, "spawn"): - return run_cmd_subprocess(command) - - return run_cmd_pexpect(command) + return run_cmd_subprocess(command) def run_cmd_subprocess(command):