From 3ff2cb8dbe7ac79a3524049fc74ec597b24e9a85 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Thu, 10 Aug 2023 17:17:51 -0300 Subject: [PATCH] append voice messages to input history --- aider/commands.py | 1 + aider/io.py | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/aider/commands.py b/aider/commands.py index 37652bb3f..62bdc8c03 100644 --- a/aider/commands.py +++ b/aider/commands.py @@ -441,6 +441,7 @@ class Commands: return text = voice.record_and_transcribe() + self.io.add_to_file_history(text) print() self.io.user_input(text, log_only=False) print() diff --git a/aider/io.py b/aider/io.py index 14a499fca..c56589c20 100644 --- a/aider/io.py +++ b/aider/io.py @@ -231,6 +231,11 @@ class InputOutput: self.user_input(inp) return inp + def add_to_file_history(self, inp): + if not self.input_history_file: + return + FileHistory(self.input_history_file).append_string(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()