Bug 136684 - add 256 color support for screen
Summary: add 256 color support for screen
Status: RESOLVED FIXED
Alias: None
Product: SUSE Linux 10.1
Classification: openSUSE
Component: Other (show other bugs)
Version: unspecified
Hardware: Other Other
: P5 - None : Enhancement (vote)
Target Milestone: ---
Assignee: Michael Schröder
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-02 14:53 UTC by Marcus Rückert
Modified: 2006-03-01 11:35 UTC (History)
1 user (show)

See Also:
Found By: Other
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
terminfo entry (1.22 KB, text/plain)
2006-02-28 18:02 UTC, Michael Schröder
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marcus Rückert 2005-12-02 14:53:56 UTC
as we have some terminals with 256 color support it would be cool if you can add the same to screen.

any ETA?:)
Comment 1 Olaf Dabrunz 2006-01-12 22:38:33 UTC
What about 256 color support in xterm?

AFAICS, this requires us to build xterm with "--enable-256-color":

--- xterm.spec.orig     2006-01-04 11:37:25.000000000 +0100
+++ xterm.spec  2006-01-12 23:13:13.000000000 +0100
@@ -105,7 +105,8 @@ xmkmf -a
 make CCOPTIONS="$RPM_OPT_FLAGS"
 pushd ../vttest-20050107
   export CFLAGS=$RPM_OPT_FLAGS
-  ./configure --prefix=/usr --mandir=%{_mandir}
+  ./configure --prefix=/usr --mandir=%{_mandir} \
+            --enable-256-color
   make
 popd
 for i in *.bdf
Comment 2 Olaf Dabrunz 2006-01-12 22:52:08 UTC
Sieht schick aus.

Es fehlen die termcap/terminfo-Einträge...
Comment 3 Olaf Dabrunz 2006-01-13 03:11:50 UTC
Hmmm...

xterm on a SuSE 9.1-i386 seems to have 256 colors.

AFAICS from the package, it was still built within the XFree86 tree.
The xtermcfg.h provided in xterm-simple.patch (in xterm-patches.tar.gz) has

#define OPT_256_COLORS 1

This file seems to have been the result of a ./configure with
--enable-256-color.

This option must have been dropped when xterm was separated out of
XFree86/xorg-x11. At least I can see no changelog entry explaining the change.

Maybe --enable-256-color was simply forgotten (since the old configure call
was not recorded in xorg-x11.spec) and it is OK to enable it again?
Comment 4 Stefan Dirsch 2006-01-13 05:50:25 UTC
Olaf, xterm is still built with 256 color support.

/work/SRC/all/xterm/p_xterm-config.diff:
[...]
+#define OPT_256_COLORS 1               /* CF_ARG_ENABLE(256-color) */
[...]

> pushd ../vttest-20050107
>    export CFLAGS=$RPM_OPT_FLAGS
> -  ./configure --prefix=/usr --mandir=%{_mandir}
> +  ./configure --prefix=/usr --mandir=%{_mandir} \
> +            --enable-256-color
>    make
>  popd

You're talking about vttest, not xterm ...

http://invisible-island.net/xterm/
http://invisible-island.net/vttest/vttest.html
Comment 5 Olaf Dabrunz 2006-01-13 11:30:09 UTC
Oh, I see. Thanks.

Comment 6 Olaf Dabrunz 2006-01-13 12:36:00 UTC
After compiling screen with --enable-colors256 and starting screen in an xterm
with

TERM=xterm-256color screen

this switches on 256 colors in screen windows (as can be seen e.g. by using
this test: xterm-208/vttests/256colors.pl).

elinks (-> mrueckert) can use these colors when its settings are set to
256 colors (Menu -> Setup -> Terminal options -> 256 colors).

So it is not necessary in all cases to have a screen-256color TERM-type.
Of course, we still should create screen-256color termcap/terminfo entries.


BTW, the number of colors is not defined in the termcap entries for either
xterm or xterm-256color:

--- termcap.xterm       2006-01-13 13:19:36.000000000 +0100
+++ termcap.xterm-256color      2006-01-13 13:19:10.000000000 +0100
@@ -1,17 +1,17 @@
-xterm|xterm terminal emulator (X Window System):\
+xterm-256color|xterm with 256 colors:\
        :am:bs:km:mi:ms:xn:\
        :co#80:it#8:li#24:\
        :AL=\E[%dL:DC=\E[%dP:DL=\E[%dM:DO=\E[%dB:IC=\E[%d@:\
        :K2=\EOE:LE=\E[%dD:RI=\E[%dC:SF=\E[%dS:SR=\E[%dT:\
        :UP=\E[%dA:ae=\E(B:al=\E[L:as=\E(0:bl=^G:bt=\E[Z:cd=\E[J:\
        :ce=\E[K:cl=\E[H\E[2J:cm=\E[%i%d;%dH:cr=^M:\
        :cs=\E[%i%d;%dr:ct=\E[3g:dc=\E[P:dl=\E[M:do=^J:ec=\E[%dX:\
        :ei=\E[4l:ho=\E[H:im=\E[4h:is=\E[!p\E[?3;4l\E[4l\E>:\
        :k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:k5=\E[15~:k6=\E[17~:\
        :k7=\E[18~:k8=\E[19~:k9=\E[20~:kD=\E[3~:kI=\E[2~:kN=\E[6~:\
-       :kP=\E[5~:kb=\177:kd=\EOB:ke=\E[?1l\E>:kh=\EOH:kl=\EOD:\
+       :kP=\E[5~:kb=^H:kd=\EOB:ke=\E[?1l\E>:kh=\EOH:kl=\EOD:\
        :kr=\EOC:ks=\E[?1h\E=:ku=\EOA:le=^H:mb=\E[5m:md=\E[1m:\
        :me=\E(B\E[m:mr=\E[7m:nd=\E[C:rc=\E8:sc=\E7:se=\E[27m:\
        :sf=^J:so=\E[7m:sr=\EM:st=\EH:ta=^I:te=\E[?1049l:\
        :ti=\E[?1049h:ue=\E[24m:up=\E[A:us=\E[4m:vb=\E[?5h\E[?5l:\
        :ve=\E[?12l\E[?25h:vi=\E[?25l:vs=\E[?12;25h:


Only terminfo has them:

od@blackberry:~> infocmp -d xterm xterm-256color
infocmp -d xterm xterm-256color
comparing xterm to xterm-256color.
    comparing booleans.
        ccc: F:T.
    comparing numbers.
        colors: 8, 256.
        pairs: 64, 32767.
    comparing strings.
        initc: NULL, '\E]4;%p1%d;rgb\:%p2%{255}%*%{1000}%/%2.2X/%p3%{255}%*%{1000}%/%2.2X/%p4%{255}%*%{1000}%/%2.2X\E\\'.
        kbs: '\177', '^H'.
        kfnd: '\E[1~', NULL.
        kslt: '\E[4~', NULL.
        setab: '\E[4%p1%dm', '\E[48;5;%p1%dm'.
        setaf: '\E[3%p1%dm', '\E[38;5;%p1%dm'.
        setb: '\E[4%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m', '\E[48;5;%p1%dm'.
        setf: '\E[3%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m', '\E[38;5;%p1%dm'.

Comment 7 Thomas Dickey 2006-02-08 22:43:15 UTC
The strings have been in xterm's termcap for a few years (I see
it in 2003/10/10 - patch #180).  vttest doesn't have a 256-color
option.
Comment 8 Michael Schröder 2006-02-28 16:41:25 UTC
Fixed in STABLE. (maybe we should add screen-256color to the ncurses terminfo, though. CC werner)
Comment 9 Dr. Werner Fink 2006-02-28 16:49:58 UTC
Most programs are using terminfo and not termcap.  Beside this
the termcap entries will be generated from the misc/terminfo.src
as well as the entries in /usr/share/terminfo/.  Therefore there
is nothing todo.
Comment 10 Michael Schröder 2006-02-28 17:11:29 UTC
I wasn't talking about termcap. I was talking about adding a "screen-256color" terminfo entry in the ncurses package, which currently only contains 'screen' and 'screen-w'.
Comment 11 Dr. Werner Fink 2006-02-28 17:55:43 UTC
Do you have an terminfo entry for screen-256color around?
Comment 12 Michael Schröder 2006-02-28 18:02:17 UTC
Created attachment 70687 [details]
terminfo entry

screen-256color terminfo entry
Comment 13 Dr. Werner Fink 2006-02-28 18:11:00 UTC
broken, no kbs ... please provide an entry like

screen-256color|VT 100/ANSI X3.64 virtual terminal with 256 colors,
       colors#256, pairs#32767, use=screen,
Comment 14 Michael Schröder 2006-03-01 11:21:38 UTC
It's not broken, this is how the screen terminfo entry looks since ages. kbs is not a mandatory field, and it is always wrong.

If you want an entry with 'use', use:

screen-256color|VT 100/ANSI X3.64 virtual terminal with 256 colors,
       colors#256, pairs#32767, setab=\E[48;5;%p1%dm, setaf=\E[38;5;%p1%dm,
       use=screen,

Don't forget to change the spaces back to tabs...
Comment 15 Dr. Werner Fink 2006-03-01 11:35:28 UTC
Added to default list together with xterm-256color.