diff --git a/src/prompt.c b/src/prompt.c index abee94ea..9722cf10 100644 --- a/src/prompt.c +++ b/src/prompt.c @@ -200,7 +200,10 @@ void do_statusbar_verbatim_input(void) bytes = get_verbatim_kbinput(bottomwin, &count); - inject_into_answer(bytes, count); + if (count > 0) + inject_into_answer(bytes, count); + else + beep(); free(bytes); } diff --git a/src/text.c b/src/text.c index 7b08f7f6..b8824b21 100644 --- a/src/text.c +++ b/src/text.c @@ -3016,6 +3016,7 @@ void do_verbatim_input(void) /* Read in the first one or two bytes of the next keystroke. */ bytes = get_verbatim_kbinput(edit, &count); + if (count > 0) { /* Unsuppress cursor-position display or blank the status bar. */ if (ISSET(CONSTANT_SHOW)) lastmessage = VACUUM; @@ -3024,6 +3025,8 @@ void do_verbatim_input(void) /* Insert the bytes into the edit buffer. */ inject(bytes, count); + } else + statusline(ALERT, _("Invalid code")); free(bytes); }