Fix curses quitting when trying to move
parse_escape_sequence changed getch timeout, but when receiving a certain escape sequence, it returned without changing the timeout back. This caused all subsequent getch calls be non-blocking, and getch returns ERR when there's no input waiting in that mode. NetHack interprets ERR as the terminal going away, so performs an automatic save.
This commit is contained in:
@@ -1073,8 +1073,10 @@ parse_escape_sequence(void)
|
|||||||
if (ret == 'O') { /* Numeric keypad */
|
if (ret == 'O') { /* Numeric keypad */
|
||||||
/* ESC O <something> */
|
/* ESC O <something> */
|
||||||
ret = getch();
|
ret = getch();
|
||||||
if (ret >= 112 && ret <= 121)
|
if (ret >= 112 && ret <= 121) {
|
||||||
|
timeout(-1);
|
||||||
return ret - 112 + '0'; /* Convert to number */
|
return ret - 112 + '0'; /* Convert to number */
|
||||||
|
}
|
||||||
|
|
||||||
if (ret == ERR)
|
if (ret == ERR)
|
||||||
ret = 'O'; /* there was no third char; treat as ESC O below */
|
ret = 'O'; /* there was no third char; treat as ESC O below */
|
||||||
|
|||||||
Reference in New Issue
Block a user