feat: Update add_to_input_history to immediately update prompt session history

This commit is contained in:
Paul Gauthier (aider) 2024-11-20 08:16:55 -08:00
parent 3bb8b163b8
commit 2ac077603b

View file

@ -478,8 +478,8 @@ class InputOutput:
return return
FileHistory(self.input_history_file).append_string(inp) FileHistory(self.input_history_file).append_string(inp)
# Also add to the in-memory history if it exists # Also add to the in-memory history if it exists
if hasattr(self, "session") and hasattr(self.session, "history"): if self.prompt_session and self.prompt_session.history:
self.session.history.append_string(inp) self.prompt_session.history.append_string(inp)
def get_input_history(self): def get_input_history(self):
if not self.input_history_file: if not self.input_history_file: