From 359e4129c6da51bda6ca35bb0374bcfb0cf34e58 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Tue, 20 Aug 2024 17:31:36 -0700 Subject: [PATCH] fix: Combine stdout and stderr, output directly without additional messages --- aider/coders/editblock_coder.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/aider/coders/editblock_coder.py b/aider/coders/editblock_coder.py index 70e30453e..04a1b9e9f 100644 --- a/aider/coders/editblock_coder.py +++ b/aider/coders/editblock_coder.py @@ -40,19 +40,14 @@ class EditBlockCoder(Coder): if self.io.confirm_ask("Do you want to run this suggested shell command?"): try: result = subprocess.run( - edit, shell=True, check=True, text=True, capture_output=True + edit, shell=True, text=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT ) - self.io.tool_output( - f"Command executed successfully. Output:\n{result.stdout}" - ) - if result.stderr: - self.io.tool_output(f"Errors:\n{result.stderr}") + self.io.tool_output(result.stdout) passed.append(edit) except subprocess.CalledProcessError as e: - self.io.tool_error(f"Command execution failed. Error:\n{e.stderr}") + self.io.tool_output(e.output) failed.append(edit) else: - self.io.tool_output("Command execution skipped.") failed.append(edit) else: path, original, updated = edit