mirror of
git://git.sv.gnu.org/nano.git
synced 2024-11-25 06:09:38 +03:00
input: properly check the full escape sequences for all keys
Also for Delete, End, PageUp and PageDown (on some terminals) the last byte in the sequence needs to be checked. This fixes https://savannah.gnu.org/bugs/?49710.
This commit is contained in:
parent
c1a484270b
commit
d48071b2b2
16
src/winio.c
16
src/winio.c
@ -1015,18 +1015,26 @@ int convert_sequence(const int *seq, size_t seq_len)
|
||||
break;
|
||||
case '3': /* Esc [ 3 ~ == Delete on VT220/VT320/
|
||||
* Linux console/xterm/Terminal. */
|
||||
return KEY_DC;
|
||||
if (seq_len > 2 && seq[2] == '~')
|
||||
return KEY_DC;
|
||||
break;
|
||||
case '4': /* Esc [ 4 ~ == End on VT220/VT320/Linux
|
||||
* console/xterm. */
|
||||
return KEY_END;
|
||||
if (seq_len > 2 && seq[2] == '~')
|
||||
return KEY_END;
|
||||
break;
|
||||
case '5': /* Esc [ 5 ~ == PageUp on VT220/VT320/
|
||||
* Linux console/xterm/Terminal;
|
||||
* Esc [ 5 ^ == PageUp on Eterm. */
|
||||
return KEY_PPAGE;
|
||||
if (seq_len > 2 && (seq[2] == '~' || seq[2] == '^'))
|
||||
return KEY_PPAGE;
|
||||
break;
|
||||
case '6': /* Esc [ 6 ~ == PageDown on VT220/VT320/
|
||||
* Linux console/xterm/Terminal;
|
||||
* Esc [ 6 ^ == PageDown on Eterm. */
|
||||
return KEY_NPAGE;
|
||||
if (seq_len > 2 && (seq[2] == '~' || seq[2] == '^'))
|
||||
return KEY_NPAGE;
|
||||
break;
|
||||
case '7': /* Esc [ 7 ~ == Home on Eterm/rxvt,
|
||||
* Esc [ 7 $ == Shift-Home on Eterm/rxvt. */
|
||||
if (seq_len > 2 && seq[2] == '~')
|
||||
|
Loading…
Reference in New Issue
Block a user