verbatim: insert the full code sequence when <Alt+Backspace> is pressed

(This could lead to unwanted behavior when the user wants to enter
a literal escape character (0x1B) while the input is somehow getting
stalled, because then a command keystroke after the M-V <Esc> would
get inserted verbatim too, instead of getting acted upon.  But that
is a small price to pay for getting the correct behavior for both
M-V M-Bsp and M-V M-Enter.)

This fixes https://savannah.gnu.org/bugs/?58909.

Bug existed since version 2.6.3, commit 08c51cfd,
but also occurred erratically beforehand.
master
Benno Schulenberg 2020-08-07 15:52:35 +02:00
parent 5a6a74fe70
commit cdd6882541
1 changed files with 3 additions and 3 deletions

View File

@ -1420,9 +1420,9 @@ int *parse_verbatim_kbinput(WINDOW *win, size_t *count)
free(kbinput); free(kbinput);
/* If this is an iTerm/Eterm/rxvt double escape, take both Escapes. */ /* In case of an escape, take also a second code, as it might be another
if (key_buffer_len > 3 && *key_buffer == ESC_CODE && * escape (on iTerm2/rxvt) or a control code (for M-Bsp and M-Enter). */
key_buffer[1] == ESC_CODE && key_buffer[2] == '[') if (key_buffer_len > 1 && *key_buffer == ESC_CODE)
*count = 2; *count = 2;
return get_input(NULL, *count); return get_input(NULL, *count);