Add support for 'y' and 'n' responses in the 'cmd_run' method

This commit is contained in:
Your Name (aider) 2024-07-28 19:05:19 -03:00
parent 926f9cc39a
commit 49f332db3f

View file

@ -620,14 +620,14 @@ class Commands:
add = result.returncode != 0 add = result.returncode != 0
else: else:
response = self.io.prompt( response = self.io.prompt(
"Add the output to the chat? (yes/no/instructions): ", "Add the output to the chat? (yes/y/no/n/instructions): ",
default="no" default="no"
).lower().strip() ).lower().strip()
if response == "yes": if response in ["yes", "y"]:
add = True add = True
instructions = None instructions = None
elif response == "no": elif response in ["no", "n"]:
add = False add = False
instructions = None instructions = None
else: else: