mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-29 00:35:00 +00:00
feat: Add shell command to input history before execution
This commit is contained in:
parent
623e4bb2d9
commit
4537e1a9f5
2 changed files with 5 additions and 0 deletions
|
@ -50,6 +50,8 @@ class EditBlockCoder(Coder):
|
|||
self.io.tool_output(f"{edit.strip()}", bold=True)
|
||||
if self.io.confirm_ask("Do you want to run this suggested shell command?"):
|
||||
try:
|
||||
# Add the command to input history
|
||||
self.io.add_to_input_history(f"/run {edit.strip()}")
|
||||
self.run_interactive_subprocess(edit.split())
|
||||
except Exception as e:
|
||||
self.io.tool_error(str(e))
|
||||
|
|
|
@ -311,6 +311,9 @@ class InputOutput:
|
|||
if not self.input_history_file:
|
||||
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)
|
||||
|
||||
def get_input_history(self):
|
||||
if not self.input_history_file:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue