append voice messages to input history

This commit is contained in:
Paul Gauthier 2023-08-10 17:17:51 -03:00
parent 4812d17372
commit 3ff2cb8dbe
2 changed files with 6 additions and 0 deletions

View file

@ -441,6 +441,7 @@ class Commands:
return return
text = voice.record_and_transcribe() text = voice.record_and_transcribe()
self.io.add_to_file_history(text)
print() print()
self.io.user_input(text, log_only=False) self.io.user_input(text, log_only=False)
print() print()

View file

@ -231,6 +231,11 @@ class InputOutput:
self.user_input(inp) self.user_input(inp)
return 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): def user_input(self, inp, log_only=True):
if not log_only: if not log_only:
style = dict(style=self.user_input_color) if self.user_input_color else dict() style = dict(style=self.user_input_color) if self.user_input_color else dict()