Bug 1219626 - Arrow keys do not work in some ncurses program (less, ncdu, ...) running under urxvt
Summary: Arrow keys do not work in some ncurses program (less, ncdu, ...) running unde...
Status: RESOLVED FIXED
Alias: None
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: Other (show other bugs)
Version: Current
Hardware: Other openSUSE Tumbleweed
: P5 - None : Normal (vote)
Target Milestone: ---
Assignee: E-mail List
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-02-06 12:44 UTC by Michael Pujos
Modified: 2024-02-26 10:50 UTC (History)
3 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---
werner: needinfo? (pujos.michael)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Pujos 2024-02-06 12:44:16 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.
Comment 1 Michael Pujos 2024-02-11 17:46:41 UTC
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)
Comment 2 Michael Pujos 2024-02-11 17:52:17 UTC
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.
Comment 3 Michael Pujos 2024-02-11 19:04:50 UTC
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'.
Comment 4 Michael Pujos 2024-02-11 19:06:29 UTC
EDIT: It is the opposite: 

left: 20240113, working; right: 20240120, not working.
Comment 5 Michael Pujos 2024-02-11 19:42:26 UTC
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
Comment 6 Dr. Werner Fink 2024-02-12 14:01:32 UTC
As my patch for terminfo entry of rxvt-unicode-256color has *NOT* changed I'd like to what else has changed as well
Comment 7 Michael Pujos 2024-02-12 14:22:18 UTC
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.
Comment 8 OBSbugzilla Bot 2024-02-12 15:45:02 UTC
This is an autogenerated message for OBS integration:
This bug (1219626) was mentioned in
https://build.opensuse.org/request/show/1146208 Factory / ncurses
Comment 9 Michael Pujos 2024-02-17 16:12:45 UTC
Fixed in terminfo-base 6.4.20240210-31.1 (TW20240212).