diff --git a/doc/fixes37.0 b/doc/fixes37.0 index 947c85f98..33ae2468e 100644 --- a/doc/fixes37.0 +++ b/doc/fixes37.0 @@ -754,6 +754,10 @@ curses: for vertical status, line up conditions in columns; usually two but curses: indent items in perm_invent window by one space curses: don't change the terminal's default colors curses: remove unnecessary special handling for dark gray +curses: sometimes entering a count during menu selection caused the menu to + disappear (example was apply/loot in-out container menu with two or + more digits typed followed by non-digit); in-out menu was still active + but no longer displayed macOS: Xcode project was failing to build if the path to the NetHack source tree contained a space; the issue was within some shell script code contained within the project diff --git a/win/curses/cursdial.c b/win/curses/cursdial.c index a2cebc24c..d00a2df88 100644 --- a/win/curses/cursdial.c +++ b/win/curses/cursdial.c @@ -1497,12 +1497,15 @@ menu_get_selections(WINDOW *win, nhmenu *menu, int how) default: if (isdigit(curletter)) { count = curses_get_count(curletter - '0'); - touchwin(win); - refresh(); + /* after count, we know some non-digit is already pending */ curletter = getch(); - if (count > 0) { - count_letter = curletter; - } + count_letter = (count > 0) ? curletter : '\0'; + + /* remove the count wind (erases last line of message wind) */ + curses_count_window(NULL); + /* force redraw of the menu that is receiving the count */ + touchwin(win); + wrefresh(win); } } diff --git a/win/curses/cursmisc.c b/win/curses/cursmisc.c index b65364a58..3e996ed4f 100644 --- a/win/curses/cursmisc.c +++ b/win/curses/cursmisc.c @@ -65,7 +65,7 @@ curses_read_char(void) } #endif - if (counting && !isdigit(ch)) { /* Dismiss count window if necissary */ + if (counting && !isdigit(ch)) { /* dismiss count window if necessary */ curses_count_window(NULL); curses_refresh_nethack_windows(); }