-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Interpreter hangs on macOS when executing any shell command #880
Comments
Re-tested with Python 3.11 with identical results. Full output below.
|
Can you run:
and paste the output here? |
I have the same problem as the OP. Python=3.11. |
Yeah this showed the debug messages but all of them stop as soon as OI is asked to execute the AppleScript command. This is the last message I see (I have to CTRL-C twice to close OI; when I do CTRL-C once, I see the error message below and OI starts talking about the fact that the operation was not successful, so I must CTRL-C again.
OI's message after this (I CTRL-C-interrupted it):
|
Ran it with -v -y. Output is about 100k lines and non-trivial to scrub. Below the lines before/after the shell call. I agree with @ibehnam that there isn't much to work with here.
|
I have exactly the same bug. Everything hangs on any shell exec |
I couldn't get the shell to work, but |
same issue. |
adding sudo doesn't fix it for me, hangs on any command execution as well. ipython and python code execution works. |
I have the same issue; adding |
With some tests I found that when OI try to execute some |
I will open a PR to fix this issue this weekend. |
@Steve235lab I've never used to |
I ran into the same or a related issue. I have some hosts in my environment set up for ssh keyed access i.e. no password required. I wanted to use OI to execute a series of commands on those hosts using ssh but I got the same hang. To diagnose the issue I used the simplest possible command i.e. 'ssh user@myhost "echo Hello!"' If I execute this in the terminal it works as expected - ssh just exits after the remote system returned "Hello!" But executing this in OI results in the hang. The issue here is that the subprocess keeps running because stdin is open and the remote host, therefore, waits for further input. I experimented with closing stdin immediately after sending the code (in core/computer/terminal/languages/subprocess.py and then: poll for process exit, make sure to read to EOF for stdout and stderr. This works as expected. The problem is that this will only work properly for interactive code which waits for additional input once it start up in the subprocess. Not really sure that this is even desirable. In any event, in case it's useful, I have attached my changes to subprocess.py that works very well for me. Perhaps there's some thought needed for making a distinction between running shell commands for interactive code versus non-interactive? Here's the updated code:
|
When oi runs a sudo command, I usually do not see the first password prompt. If it hangs after sudo, type in your password. Or if you want to make sure, just hit enter and it will re-prompt you for sudo password. |
Describe the bug
Interpreter always hangs on macOS when executing shell commands which makes it practically unusable as it disables both shell commands and apple script. Bug may be the same as #556 or #557 , but as both are old, opening a new one. Tested with different shells and different versions of Python on macOS.
Reproduce
On macOS 13.6.2 Ventura running on an M1 MacBook Pro:
Expected behavior
No hanging.
Screenshots
Open Interpreter version
0.2.0
Python version
3.12.1 (also tested with 3.7 with identical results)
Operating System name and version
macOS 13.6.2 Ventura
Additional context
Also tested zsh, bash and fish. All shells produce the same result.
The text was updated successfully, but these errors were encountered: