reliably exit on confirmation

Until now you had to press ctrl-x twice in rapid succession to exit if
an app turned on non-blocking keyboard with nodelay(true). This became
particularly noticeable after the previous change to anagrams.tlv, which
could no longer exit.
This commit is contained in:
Kartik K. Agaram 2022-03-05 14:44:37 -08:00
parent f72340cc37
commit 5530995188
1 changed files with 5 additions and 1 deletions

View File

@ -1343,7 +1343,11 @@ Wgetch(lua_State *L)
color_set(COLOR_PAIR_NORMAL, NULL);
attroff(A_BOLD|A_REVERSE);
if (wgetch(w) != c)
int secondc;
do /* just in case getch is currently non-blocking (nodelay) */
secondc = wgetch(w);
while(secondc == ERR);
if (c != secondc)
return pushintresult(0);
if (c == CTRL_X) {