From bdf25aff97ccb5694a77853627c66f54da83f8bb Mon Sep 17 00:00:00 2001 From: cohrs Date: Sun, 3 Feb 2002 07:46:05 +0000 Subject: [PATCH] tty: msg_window display anomaly If you interrupt nethack (^C) in tty windowport mode while a pompt is displayed and and msg_window=true, it can display the full message history at an unexpected time. Detect this and display only the topl, as expected. --- win/tty/topl.c | 2 +- win/tty/wintty.c | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/win/tty/topl.c b/win/tty/topl.c index 02d0df029..1d11d90be 100644 --- a/win/tty/topl.c +++ b/win/tty/topl.c @@ -29,7 +29,7 @@ tty_doprev_message() winid prevmsg_win; int i; - if (iflags.prevmsg_window) { + if (iflags.prevmsg_window && !ttyDisplay->inread) { prevmsg_win = create_nhwindow(NHW_MENU); putstr(prevmsg_win, 0, "Message History"); putstr(prevmsg_win, 0, ""); diff --git a/win/tty/wintty.c b/win/tty/wintty.c index 842bf1d4b..64e659dc6 100644 --- a/win/tty/wintty.c +++ b/win/tty/wintty.c @@ -2222,8 +2222,7 @@ tty_wait_synch() /* this can only happen if we were reading and got interrupted */ ttyDisplay->toplin = 3; /* do this twice; 1st time gets the Quit? message again */ - if (!iflags.prevmsg_window) - (void) tty_doprev_message(); + (void) tty_doprev_message(); (void) tty_doprev_message(); ttyDisplay->intr++; (void) fflush(stdout);