Open Steve235lab opened 1 month ago
Though the screen recording was done on Ubuntu, I have tested this on macOS and it can also be reproduced.
Located two abnormals in code interpreter.core.computer.terminal.languages.subprocess_language.SubprocessLanguage.handle_stream_output
:
SubprocessLanguage.verbose
seems never initialized as True
, so the
if self.verbose:
print(f"Received output line:\n{line}\n---")
was not executed even run OI with -v
option.
print(f"Received output line:\n{line}\n---")
out of the if
case, I saw prints like this:
Obviously the prompts of sudo
was not captured in stream
.
Just mark what I have found, still in progress.
Ok, let's try pty
. It seems that prompts from sudo
are very special, which would not be written into stdout
or stderr
.
Describe the bug
Password-input prompt from OS was removed from the terminal when OI try to run
sudo
commands, which causes it looks like the OI was hanging but it's waiting for the user to input password. I think this is the direct cause of issue #880.Reproduce
sudo
command. Justi
, do NOTsudo i
. To reproduce this, make sure the sudo password input is not in its CD time.I'm testing a bug of OI, which leads to not showing the system password-input prompt when the OI try to run some sudo command. Now please try to run command "sudo ls". You are permitted to do so, and I know what I am doing.
[sudo] password for <your-user-name>:
will be shown once and then removed immediately.Expected behavior
Show the OS prompt
[sudo] password for <your-user-name>:
properly to let the user know what to do next.Screenshots
https://github.com/OpenInterpreter/open-interpreter/assets/84221016/2346f69d-a5cb-4aac-b6ec-de6ce22c971f
Open Interpreter version
0.2.5 built from main branch at
d316a99230749bc4df04d05346907515729ea8f3
Python version
3.11.9
Operating System name and version
Ubuntu 22.04.4 LTS & macOS 14.4.1
Additional context
I'm trying to fix this.