fix #K4097 - ^C during DECgraphics on tty

For tty, if ^C interrupt occurred while the terminal was displaying
VT line drawing characters, it wouldn't finish updating the map and
switch back to regular characters, so the "Really quit?" prompt was
illegible.

Rather than muck about with the signal handler, just add a fixup to
tty_putstr() since prompting ultimately uses putstr(WIN_MESSAGE).
Reproducing the situation isn't straightforward; I didn't even try.
This commit is contained in:
PatR
2024-02-03 16:22:45 -08:00
parent 0d7fc06eb9
commit 73feb80a00
2 changed files with 13 additions and 0 deletions

View File

@@ -2225,6 +2225,16 @@ tty_putstr(winid window, int attr, const char *str)
int suppress_history = (attr & ATR_NOHISTORY),
urgent_message = (attr & ATR_URGENT);
#if defined(ASCIIGRAPH) && !defined(NO_TERMS)
/* if ^C occurs, player is prompted with "Really quit?" and that
prompt is issued via tty_putstr(WIN_MESSAGE); if ^C happens
while writing DECgraphics chars, the prompt text would be
rendered as VT line-drawing characters unless we do this */
if (GFlag) {
graph_off();
GFlag = FALSE;
}
#endif
/* if message is designated 'urgent' don't suppress it if user has
typed ESC at --More-- prompt when dismissing an earlier message;
besides turning off WIN_STOP, we need to prevent current message