1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:07:35 +00:00

LibLine: Handle read events serially

Previously LibLine accepted read callbacks while it was in the process
of reading input, this wasn't an issue as no async code was being
executed up until the Shell autocompletion came along.
Simply defer input processing while processing input to avoid causing
problems.
Fixes #13280.
This commit is contained in:
Ali Mohammad Pur 2022-03-27 22:52:31 +04:30 committed by Andreas Kling
parent 5e541aaebd
commit f6afb70b07
2 changed files with 23 additions and 0 deletions

View file

@ -791,6 +791,13 @@ void Editor::handle_interrupt_event()
void Editor::handle_read_event()
{
if (m_prohibit_input_processing) {
m_have_unprocessed_read_event = true;
return;
}
auto prohibit_scope = prohibit_input();
char keybuf[16];
ssize_t nread = 0;