general: disable the type-ahead checking that ncurses normally does

While updating the screen, ncurses by default polls the input source
now and then to see if there is new input, and if so, stops updating
the screen and waits for the next call of doupdate() or refresh().

  https://lists.gnu.org/archive/html/bug-ncurses/2024-05/msg00077.html

Disable this polling, as it is just a waste of time, and there *might*
be situations where the intruding keystroke does not actually trigger
a new update, which could result in a half-updated screen.
This commit is contained in:
Benno Schulenberg 2024-05-20 16:08:29 +02:00
parent 2445e77535
commit 259a3c70e3
1 changed files with 3 additions and 0 deletions

View File

@ -2437,6 +2437,9 @@ int main(int argc, char **argv)
mousefocusin = get_keycode("kxIN", FOCUS_IN);
mousefocusout = get_keycode("kxOUT", FOCUS_OUT);
/* Disable the type-ahead checking that ncurses normally does. */
typeahead(-1);
#ifdef HAVE_SET_ESCDELAY
/* Tell ncurses to pass the Esc key quickly. */
set_escdelay(50);