diff --git a/aider/io.py b/aider/io.py index cbbbd944a..0967b0da7 100644 --- a/aider/io.py +++ b/aider/io.py @@ -478,8 +478,8 @@ class InputOutput: return FileHistory(self.input_history_file).append_string(inp) # Also add to the in-memory history if it exists - if hasattr(self, "session") and hasattr(self.session, "history"): - self.session.history.append_string(inp) + if self.prompt_session and self.prompt_session.history: + self.prompt_session.history.append_string(inp) def get_input_history(self): if not self.input_history_file: