If you try to pause OpenHands CLI while it's makin...
# feedback
f
If you try to pause OpenHands CLI while it's making a command, you get a fatal error and exit the session
l
You mean if you press ctrl+c immediately after typing something, or while the command is running? The first case is already known I think.
f
Yes, interrupting with ctrl+c
l
Yes it's already known. The background ctrl+c handler starts only after the agent goes in running state, so there are spots where ctrl+c isn't properly covered.
f
DO we have an open issue to track it?
l
Yeah I think I opened one, let me check.
🙏 1
f
Thank you!
l
Np. If you are going to attempt to fix that, remember that on Windows you can't have 2 input listeners at the same time (=no background listener and input prompt at the same time).
c
I think we should support Windows in its own code, separate from the rest. It seems it’s too confusing and error prone to attempt to mix here
l
I don't think it's just a Windows issue, there's also the raw mode issue. Edit: in this specific case you just have to start the pause handler earlier, just don't keep it always enabled and make sure it's stopped before the next prompt to avoid potential CPR messages/crashes. Edit #2: I think I added tons of extra checks to make sure the listener is started/shut down properly, so all you need to do is to start it earlier, rather than when the agent goes in running state (it was like that before, so I didn't change that behavior).
I'm not sure if I already asked this before, but is there a reason why the CLI is not a 'proper' prompt_toolkit application? So that it could just use the key binding handler from prompt_toolkit itself and reduce the raw/cooked mode overlaps? Edit: it would be interesting to check out what all the other CLI tools are doing and see what's the best alternative. I'll see if I can have the pause listener cover everything in the meanwhile (also, should the CLI exit in case of double ctrl+c?). Edit 2: Just ran the latest CLI from main. Haven't started it for a long while. Got a CPR warning message straight after initialization. It must have missed me! ❤️