From 8af705482ea4a04e9a97500db3063701e09b0c70 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Tue, 27 Aug 2024 10:38:06 -0700 Subject: [PATCH] feat: Check if stdin is a TTY before using pexpect in run_interactive_command --- aider/utils.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aider/utils.py b/aider/utils.py index f281558e0..0bd37c0b2 100644 --- a/aider/utils.py +++ b/aider/utils.py @@ -15,6 +15,11 @@ IMAGE_EXTENSIONS = {".png", ".jpg", ".jpeg", ".gif", ".bmp", ".tiff", ".webp"} def run_interactive_command(command): + import sys + + if not sys.stdin.isatty(): + return run_interactive_command_subprocess(command) + try: import pexpect # noqa: F401 except ImportError: