mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-01 02:05:00 +00:00
feat: Handle multi-line shell commands in EditBlockCoder
This commit is contained in:
parent
c7ee5dbfec
commit
9706d54293
1 changed files with 9 additions and 7 deletions
|
@ -46,14 +46,16 @@ class EditBlockCoder(Coder):
|
||||||
if edit[0] is None:
|
if edit[0] is None:
|
||||||
edit = edit[1]
|
edit = edit[1]
|
||||||
# This is a shell command
|
# This is a shell command
|
||||||
if self.io.confirm_ask("Run shell command?", subject=edit.strip()):
|
commands = edit.strip().split('\n')
|
||||||
|
if self.io.confirm_ask("Run shell command(s)?", subject='\n'.join(commands)):
|
||||||
self.io.tool_output()
|
self.io.tool_output()
|
||||||
try:
|
for command in commands:
|
||||||
# Add the command to input history
|
try:
|
||||||
self.io.add_to_input_history(f"/run {edit.strip()}")
|
# Add the command to input history
|
||||||
self.run_interactive_subprocess(edit.split())
|
self.io.add_to_input_history(f"/run {command.strip()}")
|
||||||
except Exception as e:
|
self.run_interactive_subprocess(command.split())
|
||||||
self.io.tool_error(str(e))
|
except Exception as e:
|
||||||
|
self.io.tool_error(f"Error running command '{command}': {str(e)}")
|
||||||
else:
|
else:
|
||||||
path, original, updated = edit
|
path, original, updated = edit
|
||||||
full_path = self.abs_root_path(path)
|
full_path = self.abs_root_path(path)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue