Bug 221614

Summary: ncuses: Fails with 256 color terminal
Product: [openSUSE] openSUSE 10.2 Reporter: Bernhard Walle <bwalle>
Component: YaST2Assignee: Katarina Machalkova <kmachalkova>
Status: RESOLVED FIXED QA Contact: Jiri Srain <jsrain>
Severity: Major    
Priority: P5 - None CC: dickey, kde-maintainers, marko.schugardt, mrueckert
Version: Beta 2 plus   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: Other Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Bernhard Walle 2006-11-16 10:07:36 UTC
Both Konsole and gnome-terminal (or Terminal from Xfce, both use the VTE widget) have support for 256 colors. 

  TERM=xterm-256color yast

fails. I think an easy fix would be

  if [ "$TERM" = "xterm-256color" ] ; then
     TERM="xterm"
  fi

in the yast2 start script.
Comment 1 Thomas Dickey 2006-11-16 23:12:14 UTC
The reason for failure is not given.  Normally ncurses will work -
but without configuring for extended colors, can show only 16 colors
and 256 pairs.  Given that, applications that do not attempt to use
the extra colors in xterm-256color work fine.
Comment 2 Bernhard Walle 2006-11-17 10:44:26 UTC
Just to clarify, the bug is not present in general in ncurses applications, so mutt and mc work fine, only yast is affected.
Comment 3 Katarina Machalkova 2006-11-20 09:31:00 UTC
Wow, I can reproduce with KDE Konsole and xterm (no wonder - the support for 256 colors is afaics not compiled into SUSE xterm). YaST is running, there's even no error message in the log, but the display is just black. 
Bernhard, I just wonder what you need 256color support for ;-)

For safety sake, adding kde-maintainers to Cc:
Comment 4 Bernhard Walle 2006-11-20 09:36:59 UTC
Well, I simply want nice vim themes. :)
Comment 5 Katarina Machalkova 2006-11-21 10:48:57 UTC
OK, apparently we have some problems with xterm and linux ncurses color themes. If I use monochromatic theme in 256color xterm instead, YaST displays menus and dialogs correctly.

Since trying to adjust current themes might break the display somewhere else (on different type of terminal), it will be probably best if I create new theme specific for 256color enabled terminals. But not for 10.2, I'm afraid ;-)
Comment 6 Katarina Machalkova 2006-11-29 16:59:30 UTC
*** Bug 223896 has been marked as a duplicate of this bug. ***
Comment 7 Katarina Machalkova 2006-12-05 09:15:35 UTC
Fixed in yast2-ncurses 2.15.0
Comment 8 Marko Schugardt 2008-02-10 23:40:48 UTC
Yast2-ncurses-2.15.0 never reached openSUSE 10.2!?! Could it be that TERM=rxvt-unicode in generell is a problem for Ncurses? I mean, also in the textmode. Against comment #2 I watched a strange behavior in Vim and Mcedit too.
Comment 9 Marko Schugardt 2008-02-10 23:43:15 UTC
Reopened.
Comment 10 Marko Schugardt 2008-02-11 07:40:57 UTC
I set TERM back to TERM=xterm and the problem is gone. Maybe the problem is also allocated in /etc/DIR_COLORS? I set a "TERM rxvt-unicode" there.
Comment 11 Katarina Machalkova 2008-02-11 10:34:59 UTC
> Yast2-ncurses-2.15.0 never reached openSUSE 10.2!?! 

Right. Yast packages with 2.15.x version are part of openSUSE 10.3. I'm afraid there is nothing I can do for openSUSE 10.2 but request releasing online update. But i) as this issue affects only very few users ii) there is an easy workaround mentioned in comment #10, I doubt it'll be really worth online update. Neverethless, I can try.

> Could it be that
> TERM=rxvt-unicode in generell is a problem for Ncurses? I mean, also in the
> textmode. Against comment #2 I watched a strange behavior in Vim and Mcedit
> too.

Hm ... no clue (as only yast2-ncurses is mine). Adding darix (mrueckert) to Cc:

Comment 12 Marcus Rückert 2008-02-11 11:52:58 UTC
in generall TERM=rxvt-unicode is not a problem for ncurses (as long the terminfo file exists) i use it regularly and have no problems with vim. mc sometimes chokes on the F1-F12 keys. but i havent investigated further.
Comment 13 Marko Schugardt 2008-02-11 14:44:02 UTC
(In reply to comment #11 from Katarina Machalkova)
> Right. Yast packages with 2.15.x version are part of openSUSE 10.3. I'm afraid
> there is nothing I can do for openSUSE 10.2 but request releasing online
> update. But i) as this issue affects only very few users ii) there is an easy
> workaround mentioned in comment #10, I doubt it'll be really worth online
> update. Neverethless, I can try.
> 
I accept the workaround as solution. I was a bit afraid at the beginning. (comment #8)

(In reply to comment #12 from Marcus Rueckert)
> in generall TERM=rxvt-unicode is not a problem for ncurses (as long the
> terminfo file exists) i use it regularly and have no problems with vim. mc
> sometimes chokes on the F1-F12 keys. but i havent investigated further.
> 
Thanks for the info.