nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit 7b3649abc9393a0db6ee3e9224c66cd1dc12de70
parent 937c47898a3c82dc66a6ba43d27d6dd4fd46fd0b
Author: Benno Schulenberg <bensberg@justemail.net>
Date:   Wed,  4 May 2016 08:48:03 +0200

input: don't take multiple keystrokes to be a single sequence

For some reason the keyboard code seems to assume that all integers
waiting in the keybuffer form a single sequence.  But this isn't the
case: when there is an escape (0x1b) among them, then that is where
a new sequence starts.  So, prevent the input code from considering
an escape after a non-escape as part of the current sequence.

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

Diffstat:
Msrc/winio.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/winio.c b/src/winio.c @@ -370,7 +370,7 @@ int parse_kbinput(WINDOW *win) case 1: /* Reset the escape counter. */ escapes = 0; - if (get_key_buffer_len() == 0) { + if (get_key_buffer_len() == 0 || key_buffer[0] == 0x1b) { /* One escape followed by a non-escape, and * there aren't any other keystrokes waiting: * meta key sequence mode. Set meta_key to