curses prompting

Make the same fix to curses that was done for tty in 3.6.1:  don't
let MSGTYPE entries be matched against prompt strings.  Like tty,
curses was using ordinary pline() to issue prompts; something like
MSGTYPE=hide"yn"
could wreak havoc.  Switch to custompline(OVERRIDE_MSGTYPE,...).
This commit is contained in:
PatR
2019-04-04 13:52:14 -07:00
parent 505997a702
commit e5fea0291e
2 changed files with 7 additions and 4 deletions

View File

@@ -1,4 +1,4 @@
$NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.296 $ $NHDT-Date: 1554136021 2019/04/01 16:27:01 $
$NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.297 $ $NHDT-Date: 1554411130 2019/04/04 20:52:10 $
This fixes36.2 file is here to capture information about updates in the 3.6.x
lineage following the release of 3.6.1 in April 2018. Please note, however,
@@ -535,6 +535,7 @@ curses: highlighting of status conditions was broken by the fix for timing out
curses: if player pressed ESC at More>> prompt to suppress remaining messages
for the current move and then hero got another move on the same turn,
messages and most prompts would stay suppressed during that extra move
curses: don't let MSGTYPE=hide block prompts from being shown
vms: add compile of isaac64.c to Makefile.src and vmsbuild.com
vms+curses: add compile support but it is known to fail to build

View File

@@ -276,7 +276,9 @@ curses_character_input_dialog(const char *prompt, const char *choices,
wrefresh(askwin);
} else {
pline("%s", askstr);
/* TODO: add SUPPRESS_HISTORY flag, then after getting a response,
append it and use put_msghistory() on combined prompt+answer */
custompline(OVERRIDE_MSGTYPE, "%s", askstr);
curs_set(1);
}
@@ -348,7 +350,7 @@ curses_character_input_dialog(const char *prompt, const char *choices,
/* Kludge to make prompt visible after window is dismissed
when inputting a number */
if (digit(answer)) {
pline("%s", askstr);
custompline(OVERRIDE_MSGTYPE, "%s", askstr);
curs_set(1);
}
@@ -403,7 +405,7 @@ curses_ext_cmd()
extwin = newwin(1, messagew - 2, winy, winx);
if (messagew - 4 < maxlen)
maxlen = messagew - 4;
pline("#");
custompline(OVERRIDE_MSGTYPE, "#");
}
cur_choice[0] = '\0';