nano

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

commit 5b07e5fd1f2edc04755942fa4f87fb4d1b6a0345
parent 3cae32390d1d88a67cf68274863ce2b3861095ac
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Fri,  3 Jan 2020 12:34:15 +0100

input: discard partial sequences that Slang produces for F17 to F24

This fixes https://savannah.gnu.org/bugs/?57503.

Diffstat:
Msrc/winio.c | 10++++++++++
1 file changed, 10 insertions(+), 0 deletions(-)

diff --git a/src/winio.c b/src/winio.c @@ -1059,6 +1059,11 @@ int convert_sequence(const int *seq, size_t length, int *consumed) } else if (length > 5 && seq[3] == ';' && seq[5] == '~') /* Esc [ 1 n ; 2 ~ == F17...F20 on some terminals. */ *consumed = 6; +#ifdef USE_SLANG + else if (length == 4 && seq[3] == ';') + /* Discard broken sequences that Slang produces. */ + *consumed = 4; +#endif break; case '2': if (length > 3 && seq[3] == '~') { @@ -1095,6 +1100,11 @@ int convert_sequence(const int *seq, size_t length, int *consumed) else if (length > 5 && seq[3] == ';' && seq[5] == '~') /* Esc [ 2 n ; 2 ~ == F21...F24 on some terminals. */ *consumed = 6; +#ifdef USE_SLANG + else if (length == 4 && seq[3] == ';') + /* Discard broken sequences that Slang produces. */ + *consumed = 4; +#endif break; case '3': /* Esc [ 3 ~ == Delete on VT220/VT320/ * Linux console/xterm/Terminal. */