input: consider only O, o and [ as starters of multi-character sequences

This prevents many keycode sequences from being misconstrued when a
command key plus other keystrokes accumulate in the input buffer.

This fixes https://savannah.gnu.org/bugs/?48395.
master
Benno Schulenberg 2016-07-04 13:17:45 +02:00
parent e33a0b6dbe
commit 033376aec0
1 changed files with 2 additions and 1 deletions

View File

@ -373,7 +373,8 @@ int parse_kbinput(WINDOW *win)
case 1:
/* Reset the escape counter. */
escapes = 0;
if (get_key_buffer_len() == 0 || key_buffer[0] == 0x1b) {
if ((*kbinput != 'O' && *kbinput != 'o' && *kbinput != '[') ||
get_key_buffer_len() == 0 || *key_buffer == 0x1B) {
/* One escape followed by a single non-escape:
* meta key sequence mode. */
meta_key = TRUE;