mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-01 10:14:59 +00:00
fix: Use /bin/sh -c if it exists for run_interactive_command
This commit is contained in:
parent
9f42c3a0f4
commit
106a14cbdd
1 changed files with 9 additions and 2 deletions
|
@ -29,8 +29,15 @@ def run_interactive_command(command):
|
||||||
return b
|
return b
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Spawn the command
|
# Check if /bin/sh exists
|
||||||
child = pexpect.spawn(command, encoding="utf-8")
|
if os.path.exists('/bin/sh'):
|
||||||
|
# Use /bin/sh -c if it exists
|
||||||
|
spawn_command = ['/bin/sh', '-c', command]
|
||||||
|
child = pexpect.spawn('/bin/sh', args=['-c', command], encoding="utf-8")
|
||||||
|
else:
|
||||||
|
# Fall back to the original behavior
|
||||||
|
spawn_command = command
|
||||||
|
child = pexpect.spawn(command, encoding="utf-8")
|
||||||
|
|
||||||
# Transfer control to the user, capturing output
|
# Transfer control to the user, capturing output
|
||||||
child.interact(output_filter=output_callback)
|
child.interact(output_filter=output_callback)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue