feat: Add autocomplete support for /read-only command

This commit is contained in:
Paul Gauthier 2024-09-28 15:14:35 -07:00 committed by Paul Gauthier (aider)
parent d1ee3644ec
commit 97ddcb2ae6
3 changed files with 21 additions and 9 deletions

View file

@ -789,7 +789,9 @@ class Coder:
group = ConfirmGroup(urls)
for url in urls:
if url not in self.rejected_urls:
if self.io.confirm_ask("Add URL to the chat?", subject=url, group=group):
if self.io.confirm_ask(
"Add URL to the chat?", subject=url, group=group, allow_never=True
):
inp += "\n\n"
inp += self.commands.cmd_web(url)
added_urls.append(url)
@ -1380,7 +1382,7 @@ class Coder:
added_fnames = []
group = ConfirmGroup(new_mentions)
for rel_fname in sorted(new_mentions):
if self.io.confirm_ask(f"Add {rel_fname} to the chat?", group=group):
if self.io.confirm_ask(f"Add {rel_fname} to the chat?", group=group, allow_never=True):
self.add_rel_fname(rel_fname)
added_fnames.append(rel_fname)
else:
@ -1957,7 +1959,11 @@ class Coder:
)
prompt = "Run shell command?" if command_count == 1 else "Run shell commands?"
if not self.io.confirm_ask(
prompt, subject="\n".join(commands), explicit_yes_required=True, group=group
prompt,
subject="\n".join(commands),
explicit_yes_required=True,
group=group,
allow_never=True,
):
return
@ -1976,7 +1982,7 @@ class Coder:
accumulated_output += f"Output from {command}\n{output}\n"
if accumulated_output.strip() and not self.io.confirm_ask(
"Add command output to the chat?"
"Add command output to the chat?", allow_never=True
):
accumulated_output = ""