Bugzilla – Bug 1219626
Arrow keys do not work in some ncurses program (less, ncdu, ...) running under urxvt
Last modified: 2024-02-26 10:50:07 UTC
Since recently (unfortunately cannot tell which snapshot exactly), arrow keys (up/down/left/right) do not work anymore in some programs using ncurses, including 'less' and 'ncdu' when they are run under urxvt terminal. xterm works properly and so do urxvt if the terminal is changed to xterm's with 'urxvt -tn xterm-256color'. For now, it can be worked-around permanently adding 'URxvt.termName: xterm-256color' to ~/.Xdefaults. So it seems the culprit might be the terminfo definition of 'rxvt-unicode-256color' which is the default TERM urxvt set itself to. I also see there has been a lot of recent changes in packages libncurses6 and terminfo, so there's that. It would be great to have this fixed as it should not be necessary to fiddle with TERM to have urxvt working fine with ncurses. Interestingly, if launching 'man man' (which will spawn less, which is affected), then typing / for search, then typing left,right,up,down arrow characters in sequence, this is what is displayed in the less bottom command-line: /ESCODESCOCESCOAESCOB For some reasons, escape sequences are displayed.
I could test that reverting to these previous packages fixes this issue: - libncurses6-6.4.20240113-29.1.x86_64.rpm - terminfo-base-6.4.20240113-29.1.x86_64.rpm - terminfo-6.4.20240113-29.1.x86_64.rpm So this issue was introduced in the latest update of these packages (20240120)
Replacing /usr/share/terminfo/r/rxvt-unicode-256color from current terminfo-base package (20240120) by the one found in the 20240113 rpm fixes the issue, so there is something wrong in the rxvt-unicode-256color terminal definition.
Digging into it: (right: 20240113, working; left: 20240120, not working): infocmp rxvt-unicode-256color rxvt-unicode-256color.broken comparing rxvt-unicode-256color to rxvt-unicode-256color.broken. comparing booleans. comparing numbers. comparing strings. kbs: '^?', '^H'. kcub1: '\EOD', '\E[D'. kcud1: '\EOB', '\E[B'. kcuf1: '\EOC', '\E[C'. kcuu1: '\EOA', '\E[A'.
EDIT: It is the opposite: left: 20240113, working; right: 20240120, not working.
Issue linked to this post and following discussion on bugs-ncurse mailing-list: https://lists.gnu.org/archive/html/bug-ncurses/2024-01/msg00076.html
As my patch for terminfo entry of rxvt-unicode-256color has *NOT* changed I'd like to what else has changed as well
Yes, I had a brief look at locally building the OBS ncurses to see if there would be any obvious issue between 20240113 and 20240120 resulting in different rxvt-unicode-256color files, but could not find anything. So it requires further digging to get the bottom line of this. Currently, any rxvt user (that did not redefined it's TERM) will experience arrow keys issues in some programs.
This is an autogenerated message for OBS integration: This bug (1219626) was mentioned in https://build.opensuse.org/request/show/1146208 Factory / ncurses
Fixed in terminfo-base 6.4.20240210-31.1 (TW20240212).