Bug 644831

Summary: terminfo for linux-16color seems broken
Product: [openSUSE] openSUSE 11.3 Reporter: Rob Fortune <rob.fortune>
Component: BasesystemAssignee: Dr. Werner Fink <werner>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Minor    
Priority: P5 - None CC: dickey
Version: Final   
Target Milestone: ---   
Hardware: All   
OS: openSUSE 11.3   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: ncurses-5.7-pthread.dif

Description Rob Fortune 2010-10-08 05:46:59 UTC
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/534.8 SUSE/7.0.528.0 (KHTML, like Gecko) Chrome/7.0.528.0 Safari/534.8

I hate to use wikipedia as a reference but:

http://en.wikipedia.org/wiki/ANSI_escape_code#Colors

From an xterm-256color do:

(i=0; while test $i -lt 16; do tput sgr0; echo -n "Color ${i}: "; tput setaf $i; echo "#####"; i=$(($i + 1));done;)

You will see a good approximation of the wikipedia chart. Now do the same from a linux console with terminal set to linux-16color. It's completely different. I know ANSI didn't specify the hue but it's obviously not meant to look like that. The problems start at color 7 which should be white, but is black and continue from there.

Reproducible: Always
Comment 1 Rob Fortune 2010-10-08 05:49:10 UTC
by "with terminal set to linux-16color" I mean the TERM environment variable is set to linux-16color.
Comment 2 Rob Fortune 2010-10-08 05:57:08 UTC
If you set a higher number than 16 as the limit you will see it can display all 16 colours it just has seems to have them offset wrong, as the later blocks repeat the bright versions faithfully, in the wrong place.
Comment 3 Dr. Werner Fink 2010-10-08 08:44:21 UTC
Just take upstream into account ... and IMHO this is a minor.

Thomas? What do you think about this?
Comment 4 Thomas Dickey 2010-10-08 08:59:18 UTC
I can repeat that - agree that it doesn't look right.
I'll see what fixes I can make (thanks).
Comment 5 Thomas Dickey 2010-10-10 13:29:22 UTC
It's fixed in yesterday's patch.  By the way, there's no bright black
in Linux's default palette, so I improvised using "dim" (which renders
as gray on my machine).  It's possible to program the palette, but that's
a different thing (in turn it would be possible to program a bright black
with the terminal initialization string, but seems wasteful).
Comment 6 Dr. Werner Fink 2010-10-11 15:40:36 UTC
Thank you Thomas, I'll go to update factory to the latest version.
The only problem I'm aware is bootstraping from the latest version
with fallback terminal lines as configure does a search for a not
existing tic.
Comment 7 Thomas Dickey 2010-10-11 23:11:17 UTC
Is that a new problem (fallback entries), or the longstanding
issue that fallbacks have "always" required ncurses tic to be
available?

The only compatibility issue I recalled was that 5.7 introduced
a bug-fix for cancelled strings which is assumed in the terminal
descriptions.
Comment 8 Dr. Werner Fink 2010-10-12 10:51:05 UTC
For generating the fallback.c for e.g. xterm, linux, vt100, and vt102
the program tic is required.  I prefere the tic and misc/terminfo.src
from the current source tar ball.  For this I've to skip the configure
option --with-fallbacks and run

    make -C include
    make -C ncurses fallback.c FALLBACK_LIST=""
    make -C progs   termsort.c transform.h infocmp tic
    rm   -f ncurses/fallback.c
    PATH=$PWD/progs:$OPATH
    pushd ncurses/
        TERMINFO=$PWD/tmp
        export TERMINFO
        mkdir -p $TERMINFO
        $PWD/../progs/tic -I -r -e $FALLBK ../misc/terminfo.src > terminfo.src
        $PWD/../progs/tic -o $TERMINFO -s terminfo.src
        sh -e ./tinfo/MKfallback.sh $TERMINFO ../misc/terminfo.src $PWD/../progs/tic ${FALLBK//,/ } > fallback.c
        rm -rf $TERMINFO
        unset  TERMINFO
        cp -p fallback.c ../fallback.c.backup
    popd
    PATH=$OPATH

with FALLBK="xterm,linux,vt100,vt102"

Beside this I've detected that pthread_kill is not a weak symbol anymore
for libncurses6 and that I'm see a libncursest6.
Comment 9 Dr. Werner Fink 2010-10-12 10:54:41 UTC
Created attachment 394370 [details]
ncurses-5.7-pthread.dif

This patch moves pthread_kill back to a weak symbol and
I'm able to use

       if test $cf_cv_weak_symbols != yes ; then
               LIB_SUFFIX="t${LIB_SUFFIX}"
       fi

in configure/configure.in to see reentrant libncurses6 again which
can be used even without libpthread.
Comment 10 Thomas Dickey 2010-10-12 10:58:42 UTC
thanks
Comment 11 Thomas Dickey 2010-10-30 13:54:14 UTC
I addressed these two issues in last week's patch (20101023).