diff --git a/aider/coders/base_coder.py b/aider/coders/base_coder.py index 4d0c91333..1f9a215f4 100755 --- a/aider/coders/base_coder.py +++ b/aider/coders/base_coder.py @@ -826,7 +826,7 @@ class Coder: added_urls = [] for url in urls: if url not in self.rejected_urls: - if self.io.confirm_ask(f"Add {url} to the chat?"): + if self.io.confirm_ask(f"Add URL to the chat?", subject=url): inp += "\n\n" inp += self.commands.cmd_web(url, paginate=False) added_urls.append(url) @@ -1315,10 +1315,8 @@ class Coder: if not mentioned_rel_fnames: return - for rel_fname in mentioned_rel_fnames: - self.io.tool_output(rel_fname) - - if not self.io.confirm_ask("Add these files to the chat?"): + add_files = "\n".join(mentioned_rel_fnames) + "\n" + if not self.io.confirm_ask("Add these files to the chat?", subject=add_files): return for rel_fname in mentioned_rel_fnames: @@ -1663,7 +1661,7 @@ class Coder: return True if not Path(full_path).exists(): - if not self.io.confirm_ask(f"Allow creation of new file {path}?"): + if not self.io.confirm_ask(f"Allow creation of new file?", subject=path): self.io.tool_error(f"Skipping edits to {path}") return @@ -1682,7 +1680,8 @@ class Coder: return True if not self.io.confirm_ask( - f"Allow edits to {path} which was not previously added to chat?" + "Allow edits to file that has not been added to the chat?", + subject=path, ): self.io.tool_error(f"Skipping edits to {path}") return diff --git a/aider/coders/editblock_coder.py b/aider/coders/editblock_coder.py index 1b4f634b2..9976cc220 100644 --- a/aider/coders/editblock_coder.py +++ b/aider/coders/editblock_coder.py @@ -46,9 +46,8 @@ class EditBlockCoder(Coder): if edit[0] is None: edit = edit[1] # This is a shell command - self.io.tool_output() - self.io.tool_output(f"{edit.strip()}", bold=True) - if self.io.confirm_ask("Do you want to run this suggested shell command?"): + if self.io.confirm_ask("Run this shell command?", subject=edit.strip()): + self.io.tool_output() try: # Add the command to input history self.io.add_to_input_history(f"/run {edit.strip()}") diff --git a/aider/io.py b/aider/io.py index 07f6b3f38..52bf2acfe 100644 --- a/aider/io.py +++ b/aider/io.py @@ -357,6 +357,7 @@ class InputOutput: self.num_user_asks += 1 if subject: + self.tool_output() self.tool_output(subject, bold=True) if self.yes is True: @@ -378,6 +379,7 @@ class InputOutput: self.num_user_asks += 1 if subject: + self.tool_output() self.tool_output(subject, bold=True) if self.yes is True: diff --git a/aider/utils.py b/aider/utils.py index 909274fa3..d1cbccd13 100644 --- a/aider/utils.py +++ b/aider/utils.py @@ -281,10 +281,8 @@ def check_pip_install_extra(io, module, prompt, pip_install_cmd): cmd = get_pip_install(pip_install_cmd) - text = f"{prompt}:\n\n{' '.join(cmd)}\n" - io.tool_error(text) - - if not io.confirm_ask("Run pip install?", default="y"): + io.tool_error(prompt) + if not io.confirm_ask("Run pip install?", default="y", subject=' '.join(cmd)): return success, output = run_install(cmd) diff --git a/aider/versioncheck.py b/aider/versioncheck.py index 5ce90cd35..e0ae78c50 100644 --- a/aider/versioncheck.py +++ b/aider/versioncheck.py @@ -68,14 +68,10 @@ Newer aider version v{latest_version} is available. To upgrade, run: cmd = utils.get_pip_install(["--upgrade", "aider-chat"]) - text = f""" -Newer aider version v{latest_version} is available. To upgrade, run: + text = f"Newer aider version v{latest_version} is available. To upgrade, run:" - {' '.join(cmd)} -""" io.tool_error(text) - - if io.confirm_ask("Run pip install?"): + if io.confirm_ask("Run pip install?", subject=' '.join(cmd)): success, output = utils.run_install(cmd) if success: io.tool_output("Re-run aider to use new version.")