commit cdd68825419d1fa2882f6771b1fb42b97fd189a6
parent 5a6a74fe70695b648c8a08b5ccc95c97dafd9938
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Fri, 7 Aug 2020 15:52:35 +0200
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.
Diffstat:
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/winio.c b/src/winio.c
@@ -1420,9 +1420,9 @@ int *parse_verbatim_kbinput(WINDOW *win, size_t *count)
free(kbinput);
- /* If this is an iTerm/Eterm/rxvt double escape, take both Escapes. */
- if (key_buffer_len > 3 && *key_buffer == ESC_CODE &&
- key_buffer[1] == ESC_CODE && key_buffer[2] == '[')
+ /* In case of an escape, take also a second code, as it might be another
+ * escape (on iTerm2/rxvt) or a control code (for M-Bsp and M-Enter). */
+ if (key_buffer_len > 1 && *key_buffer == ESC_CODE)
*count = 2;
return get_input(NULL, *count);