From 37e3e561f037020fef9d9bc818e02b4a9c509100 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Sun, 28 May 2023 11:20:08 -0700 Subject: [PATCH] Fixed /run output to log --- aider/commands.py | 9 ++++++--- aider/prompts.py | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/aider/commands.py b/aider/commands.py index 8e31d2e83..758bfb22c 100644 --- a/aider/commands.py +++ b/aider/commands.py @@ -227,14 +227,17 @@ class Commands: except Exception as e: self.io.tool_error(f"Error running command: {e}") + print(combined_output) + if self.io.confirm_ask("Add the output to the chat?", default="y"): + for line in combined_output.splitlines(): + self.io.tool_output(line, log_only=True) + msg = prompts.run_output.format( command=args, output=combined_output, ) - self.io.tool_output(msg, log_only=False) - else: - print(combined_output) + return msg def cmd_exit(self, args): "Exit the application" diff --git a/aider/prompts.py b/aider/prompts.py index 07374e140..bfcca2f26 100644 --- a/aider/prompts.py +++ b/aider/prompts.py @@ -8,7 +8,7 @@ Take requests for changes to the supplied code. If the request is ambiguous, ask questions. Once you understand the request you MUST: -1. List the files you need to modify. If they are *read-only* you *MUST* ask the user to make them *read-write* using the file's full path name. +1. List the files you need to modify. Do not suggest changes to *read-only* files. You *MUST* ask the user to make them *read-write* using the file's full path name. End your reply and wait for their approval. 2. Think step-by-step and explain the needed changes. 3. Describe each change with an *edit block* per the example below. """