Bug 362634

Summary: ncurses overload 'v' shortcut
Product: [openSUSE] openSUSE 10.3 Reporter: Pavel Nemec <pnemec>
Component: YaST2Assignee: Katarina Machalkova <kmachalkova>
Status: RESOLVED FIXED QA Contact: Jiri Srain <jsrain>
Severity: Normal    
Priority: P5 - None CC: dickey, werner
Version: Final   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: screenshot of ncurses yast image management

Description Pavel Nemec 2008-02-18 09:18:40 UTC
Created attachment 195331 [details]
screenshot of ncurses yast image management

In Image management (Czech translation, bud valid also for en) all 'v' characters are marked as shortcut. see attached picture. 'v' shortcut is inactive though, and if you press alt+v nothing happened. It is quite confusing.
Comment 1 Katarina Machalkova 2008-02-22 15:24:59 UTC
You're probably using xterm, right?

What you see as 'v' character is in fact down-arrow (ACS_DARROW in ncurses terminology), which is a hint for the user that this button (or text-field) is expandable - MenuButton or ComboBox. xterm for some reason does not display down-arrow as a real arrow but uses placeholder 'v' character instead. If you set TERM=linux or use urxvt terminal emulator (TERM=rxvt) you will see correct characters.

I don't know why this is happening, if it is an error of xterm, font, or ncurses library, but it has certainly nothing to do with my code (because I want explicitly ACS_DARROW there and I'm not getting it anyway ;-) ). Investigating ...
Comment 2 Pavel Nemec 2008-02-25 07:42:09 UTC
Hm... big letters on screen shot shows that I am using KDE Terminal which is Konsole. yakukae (embeded konsole)  in this particular case. It use KDE fonts and all fonts are installed. konsole is very good in utf-8 and even with utf-16. So I will not expect problem here.  
I suggest use some solution which could be working on major number of term. As we spoke on irc something like " ..." or " []"  could be better. It is also important to put space between word and character so instead of
Filev
you will get
File v

 
Comment 3 Katarina Machalkova 2008-02-25 12:11:31 UTC
Adding sndirsch to Cc: as xterm does not seem to contain ACS_*ARROW characters in terminal description. But according to libncurses upstream maintainer, it's a feature, not a bug (although I don't quite understand his reasoning).

Jfyi: this are the escape sequences xterm prints when displaying down arrow:

Arrow Pointing DownESC[22;29Hv

This is linux console (TERM=linux):

ESC[0;10;11mESC[10mArrow Pointing DownESC[22;29HESC[0;10;11m^YESC[10m

and urxvt (TERM=rxvt-unicode):

ESC[0mESC(0ESC(BArrow Pointing DownESC[22;29HESC[0mESC(0BESC(B
Comment 4 Dr. Werner Fink 2008-02-25 13:52:05 UTC
Let's ask Thomas.  He knows more about xterm and ncurses :)
Comment 5 Katarina Machalkova 2008-02-25 13:56:19 UTC
Actually, I've already done so ;-) 

>> ncurses uses the terminal description for the narrow interface, arguably
>> because even if it "knows" what the Unicode values are, the developer
>> may intend a different mapping than ncurses' built-in table.
>
> But I don't intend to use different mapping ;-) For me, arrow characters are
> significant e.g. in menus or combo-boxes.
> So the only way how to make ncurses app display arrows in xterm is to link
> against wide version of libncurses (ncursesw) and use corresponding WACS's ?

Assuming that you're using a UTF-8 locale, that's the only way to make
it work.
Comment 6 Thomas Dickey 2008-02-25 23:16:16 UTC
right - that's what I do in dialog, e.g.,

#ifdef USE_WIDE_CURSES
#define add_acs(win, code) wadd_wch(win, W ## code)
#else
#define add_acs(win, code) waddch(win, dlg_boxchar(code))
#endif
Comment 7 Katarina Machalkova 2008-02-29 14:07:34 UTC
Now using WACS instead of ACS arrows, as those map to [v,^,<,>] in xterm, but only in UTF-enabled locale. 
The change affects comboboxes and menu buttons (as arrow characters are significant in those, and placeholder characters may be most easily confused with real letters there)
Fixed in y2-ncurses 2.16.18 (if it builds)