feat: Check if stdin is a TTY before using pexpect in run_interactive_command

This commit is contained in:
Paul Gauthier (aider) 2024-08-27 10:38:06 -07:00
parent 71066b8954
commit 8af705482e

View file

@ -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: