From aac227485159955ed73ff343d894edf7b2a40c5e Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Wed, 21 Aug 2024 15:23:09 -0700 Subject: [PATCH] fix: Use singular or plural prompt for shell commands --- aider/coders/editblock_coder.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/aider/coders/editblock_coder.py b/aider/coders/editblock_coder.py index ebc85c7ce..bf4b588ea 100644 --- a/aider/coders/editblock_coder.py +++ b/aider/coders/editblock_coder.py @@ -38,7 +38,9 @@ class EditBlockCoder(Coder): def handle_shell_commands(self, commands_str): commands = commands_str.strip().splitlines() - if not self.io.confirm_ask("Run shell command(s)?", subject="\n".join(commands)): + command_count = sum(1 for cmd in commands if cmd.strip() and not cmd.strip().startswith("#")) + prompt = "Run shell command?" if command_count == 1 else "Run shell commands?" + if not self.io.confirm_ask(prompt, subject="\n".join(commands)): return for command in commands: