mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-01 10:14:59 +00:00
fix: add error handling for input history file permissions
This commit is contained in:
parent
ded5fe5ec0
commit
200295e3ee
1 changed files with 7 additions and 4 deletions
11
aider/io.py
11
aider/io.py
|
@ -492,10 +492,13 @@ class InputOutput:
|
||||||
def add_to_input_history(self, inp):
|
def add_to_input_history(self, inp):
|
||||||
if not self.input_history_file:
|
if not self.input_history_file:
|
||||||
return
|
return
|
||||||
FileHistory(self.input_history_file).append_string(inp)
|
try:
|
||||||
# Also add to the in-memory history if it exists
|
FileHistory(self.input_history_file).append_string(inp)
|
||||||
if self.prompt_session and self.prompt_session.history:
|
# Also add to the in-memory history if it exists
|
||||||
self.prompt_session.history.append_string(inp)
|
if self.prompt_session and self.prompt_session.history:
|
||||||
|
self.prompt_session.history.append_string(inp)
|
||||||
|
except OSError as err:
|
||||||
|
self.tool_warning(f"Unable to write to input history file: {err}")
|
||||||
|
|
||||||
def get_input_history(self):
|
def get_input_history(self):
|
||||||
if not self.input_history_file:
|
if not self.input_history_file:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue