From ec91eb670ec531aa226c1e0a9d6ba997d11af3c5 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Thu, 10 Aug 2023 16:23:35 -0300 Subject: [PATCH] Refactor `cmd_voice` method to use `user_input` method instead of `tool_output`. --- aider/commands.py | 2 +- aider/io.py | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/aider/commands.py b/aider/commands.py index adbe8468c..f2b10eb6e 100644 --- a/aider/commands.py +++ b/aider/commands.py @@ -438,7 +438,7 @@ class Commands: def cmd_voice(self, args): "Record and transcribe voice input" text = record_and_transcribe() - self.io.tool_output(text) + self.io.user_input(text, log_only=False) return text diff --git a/aider/io.py b/aider/io.py index dee90b78f..5dbcc9264 100644 --- a/aider/io.py +++ b/aider/io.py @@ -231,7 +231,12 @@ class InputOutput: self.user_input(inp) return inp - def user_input(self, inp): + def user_input(self, inp, log_only=True): + + if not log_only: + style = dict(style=self.user_input_color) if self.user_input_color else dict() + self.console.print(inp, **style) + prefix = "####" if inp: hist = inp.splitlines()