mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-02 10:45:00 +00:00
copy
This commit is contained in:
parent
0c5cd64b83
commit
22318a3160
1 changed files with 5 additions and 5 deletions
|
@ -18,7 +18,7 @@ def run_cmd(command, verbose=False):
|
|||
|
||||
def run_cmd_subprocess(command, verbose=False):
|
||||
if verbose:
|
||||
print("run_cmd_subprocess:", command)
|
||||
print("Using run_cmd_subprocess:", command)
|
||||
try:
|
||||
process = subprocess.Popen(
|
||||
command,
|
||||
|
@ -52,7 +52,7 @@ def run_cmd_pexpect(command, verbose=False):
|
|||
:return: A tuple containing (exit_status, output)
|
||||
"""
|
||||
if verbose:
|
||||
print("run_cmd_pexpect:", command)
|
||||
print("Using run_cmd_pexpect:", command)
|
||||
|
||||
output = BytesIO()
|
||||
|
||||
|
@ -64,17 +64,17 @@ def run_cmd_pexpect(command, verbose=False):
|
|||
# Use the SHELL environment variable, falling back to /bin/sh if not set
|
||||
shell = os.environ.get("SHELL", "/bin/sh")
|
||||
if verbose:
|
||||
print("shell:", shell)
|
||||
print("With shell:", shell)
|
||||
|
||||
if os.path.exists(shell):
|
||||
# Use the shell from SHELL environment variable
|
||||
if verbose:
|
||||
print("pexpect.spawn with shell:", shell)
|
||||
print("Running pexpect.spawn with shell:", shell)
|
||||
child = pexpect.spawn(shell, args=["-c", command], encoding="utf-8")
|
||||
else:
|
||||
# Fall back to spawning the command directly
|
||||
if verbose:
|
||||
print("pexpect.spawn without shell")
|
||||
print("Running pexpect.spawn without shell.")
|
||||
child = pexpect.spawn(command, encoding="utf-8")
|
||||
|
||||
# Transfer control to the user, capturing output
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue