Commit 7b3649ab authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

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.
No related merge requests found
Showing with 1 addition and 1 deletion
+1 -1
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment