[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Nano-devel] [PATCH] input: ignore any <Escape>s before a valid comm
From: |
David Ramsey |
Subject: |
Re: [Nano-devel] [PATCH] input: ignore any <Escape>s before a valid command |
Date: |
Fri, 13 Jul 2018 08:33:00 -0500 |
Benno Schulenberg:
> That is strange. When you comment out the #ifdef around the "hex
> codes" fragment in winio.c, compile and run, and then type some cursor
> keys, then the "hex codes" report escape sequences instead of
> single-integer codes?
With that fragment commented out, I get:
Left arrow: 104
Shift-Left arrow: 189
Ctrl-Left arrow: 1b 5b 31 3b 35 44
Ctrl-Shift-Left arrow: 1b 5b 31 3b 36 44
Alt-Left arrow: 1b 5b 31 3b 33 44
Alt-Shift-Left arrow: 1b 5b 31 3b 34 44
When I use -K, the key values are:
Left arrow: 1b 5b 44
Shift-Left arrow: 1b 5b 31 3b 32 44
Ctrl-Left arrow: 1b 5b 31 3b 35 44
Ctrl-Shift-Left arrow: 1b 5b 31 3b 36 44
Alt-Left arrow: 1b 5b 31 3b 33 44
Alt-Shift-Left arrow: 1b 5b 31 3b 34 44
The two single values change to escape sequences, and everything else
remains the same, as expected.
> If so, then the keypad() calls in nano.c are not working. How come?
> Does it also happen when you run src/nano --ignore?
Some keys are, some aren't. (nano --ignore produces the same values,
since I'm not rebinding any keys or using -K by default.) Which means
that some sequences in the terminfo entry aren't mapped properly to
keypad values. My $TERM is xterm-256color in this case, which probably
affects things as well.
> (On my system: ncurses 6.1, libvte 0.52.2, Xfce4-terminal 0.8.7.3.)
Similar enough to mine, then. What $TERM are you using?