Extra keypresses between calls not being visibly captured
Describe the bug
In between calls (pressing "enter"), if a user makes any keypresses, they are sometimes not visibly captured and cannot be deleted before the next input. This can contaminate the input to the next call, particularly in the case of "Would you like to run this code? (y/n)".
One situation in which this is prone to happening is when users get key-happy due to API lag. For example, if a user types a prompt and presses enter, but doesn't see any result for a second, they might press enter again to "confirm" their input for good measure. Then, when the initial response has finished and OI prompts for (y/n), the "y" that the user types will be precluded from the response because the input has already been completed by pressing enter.
Reproduce
- Enter a prompt in terminal interface
- While the response is being generated press enter and/or type some words
- When prompted for "Would you like to run this code? (y/n)", enter "y"
- The system will interpret this as a default or an "n"
Expected behavior
I would imagine one of two ways of handling this:
- All keypresses that occur before the model has finished printing its output should be ignored
- All keypresses should be considered temporary input (including "enter") and should be able to be edited/deleted before finishing next input
I think the first option is safer and more understandable. Happy to make a PR to address this, let me know if there is disagreement.
Screenshots
Open Interpreter version
0.2.4
Python version
3.9.13
Operating System name and version
MacOS Sonoma 14.2.1
Additional context
No response
@tyfiero @KillianLucas Do you have thoughts on this one?