nano

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

commit b99ec28a609f96767374e815773ac95227c0130a
parent b2acffe5bed62578bcf1e5e3e0c7123b4a0812bf
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Mon, 16 Jul 2018 18:31:16 +0200

tweaks: recognize escape sequences of modified Ins/Del more precisely

The third character after the escape must be a semicolon.

Diffstat:
Msrc/winio.c | 6++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/winio.c b/src/winio.c @@ -1080,14 +1080,16 @@ int convert_sequence(const int *seq, size_t length, int *consumed) /* Esc [ 2 ~ == Insert on VT220/VT320/ * Linux console/xterm/Terminal. */ return KEY_IC; - else if (length > 4 && seq[4] == '~') + else if (length > 4 && seq[2] == ';' && seq[4] == '~') + /* Esc [ 2 ; x ~ == modified Insert on xterm. */ *consumed = 5; break; case '3': /* Esc [ 3 ~ == Delete on VT220/VT320/ * Linux console/xterm/Terminal. */ if (length > 2 && seq[2] == '~') return KEY_DC; - if (length > 4 && seq[4] == '~') + if (length > 4 && seq[2] == ';' && seq[4] == '~') + /* Esc [ 3 ; x ~ == modified Delete on xterm. */ *consumed = 5; break; case '4': /* Esc [ 4 ~ == End on VT220/VT320/