input: properly recognize Alt+Delete when using -K/--rebindkeypad

This works for xterm, rxvt, Eterm, Konsole, and xfce4-terminal, which
generate "Esc [ 3 ; 3 ~", but not for urxvt, which generates one of
its double-escape sequences, "Esc Esc [ 3 ~".
This commit is contained in:
David Lawrence Ramsey 2018-10-22 14:09:18 -05:00 committed by Benno Schulenberg
parent 252f14796e
commit f02e2d3b6e

View File

@ -1112,6 +1112,9 @@ int convert_sequence(const int *seq, size_t length, int *consumed)
#ifndef NANO_TINY
if (length > 4 && seq[2] == ';' && seq[4] == '~') {
*consumed = 5;
if (seq[3] == '3')
/* Esc [ 3 ; 3 ~ == Alt-Delete on xterm/rxvt/Eterm/Terminal. */
return ALT_DELETE;
if (seq[3] == '5')
/* Esc [ 3 ; 5 ~ == Ctrl-Delete on xterm. */
return CONTROL_DELETE;