Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 439176 - app-misc/screen with 'term screen-256color' treats colors wrong
Summary: app-misc/screen with 'term screen-256color' treats colors wrong
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-21 15:30 UTC by Lukas Schneiderbauer
Modified: 2012-10-21 16:20 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
color testing script (256colors2.pl,1.62 KB, text/plain)
2012-10-21 15:30 UTC, Lukas Schneiderbauer
Details
screenshot of script-output in plain konsole (256_konsole.png,3.80 KB, image/png)
2012-10-21 15:33 UTC, Lukas Schneiderbauer
Details
screenshot of script-output in konsole + screen (256_konsole_screen.png,3.82 KB, image/png)
2012-10-21 15:35 UTC, Lukas Schneiderbauer
Details
screenshot of eix-diff in plain konsole (eixdiff_konsole.png,162.70 KB, image/png)
2012-10-21 15:36 UTC, Lukas Schneiderbauer
Details
screenshot of eix-diff in konsole + screen without 256colors (eixdiff_konsole_screen_without256.png,177.23 KB, image/png)
2012-10-21 15:38 UTC, Lukas Schneiderbauer
Details
screenshot of eix-diff in konsole + screen with 256colors (eixdiff_konsole_screen_with256.png,164.00 KB, image/png)
2012-10-21 15:39 UTC, Lukas Schneiderbauer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lukas Schneiderbauer 2012-10-21 15:30:05 UTC
app-misc/screen with 'term screen-256color' in .screenrc is supposed to display the 256-color scheme as they would be displayed without screen but it doesn't.

For example the color-output of app-portage/eix is different (as seen in the to be uploaded screenshots).

An unmodified gentoo-default /etc/screenrc is used with or without the line 'term screen-256color' in ~/.screenrc .

The screenshots are made within kde-base/konsole. They are the same in xterm.
For testing colors I used a perl-testscript I found on the net (I lost the link but I will upload the script here as well).

Reproducible: Always

Steps to Reproduce:
1. emerge app-misc/screen
2. create ~/.screenrc with 'term screen-256color' in it.
3. call e.g. eix-diff or 256colors2.pl
4. start screen and call again
5. see the difference
Actual Results:  
The output is not colorized in the same way.

Expected Results:  
The output should be exactly the same.

Script and screenshots are following.
Comment 1 Lukas Schneiderbauer 2012-10-21 15:30:39 UTC
Created attachment 327060 [details]
color testing script
Comment 2 Lukas Schneiderbauer 2012-10-21 15:33:10 UTC
Created attachment 327062 [details]
screenshot of script-output in plain konsole

all good in a plain kde-base/konsole session.
Comment 3 Lukas Schneiderbauer 2012-10-21 15:35:46 UTC
Created attachment 327064 [details]
screenshot of script-output in konsole + screen

The colors appear as screen would not have 256color support enabled. (although it definitely changes something. see the eix-diff screenshots)
Comment 4 Lukas Schneiderbauer 2012-10-21 15:36:39 UTC
Created attachment 327066 [details]
screenshot of eix-diff in plain konsole

for reference
Comment 5 Lukas Schneiderbauer 2012-10-21 15:38:28 UTC
Created attachment 327068 [details]
screenshot of eix-diff in konsole + screen without 256colors

the line 'term screen-256color' is disabled here. The colors are different here but that's okay I suppose.
Comment 6 Lukas Schneiderbauer 2012-10-21 15:39:42 UTC
Created attachment 327070 [details]
screenshot of eix-diff in konsole + screen with 256colors

'term screen-256color' enabled here.
It looks different than the screenshot of eix-diff in plain konsole.
Comment 7 Martin Väth 2012-10-21 16:15:58 UTC
For most applications, the output of
echo "$TERM"
is relevant. If this is "screen", there is no way for an application to know
whether the actually emulated terminal can display 8 or 256 colors:
The terminal will "understand" 256 colors, but e.g. if screen is running on
a linux console, it is attempted to "map" the 256 colors to only 8 colors
which can produce unreadable results (e.g. most colors which eix uses
are just mapped to "green").

For this reason, eix (and some other applications like vim) will only use a
256 color scheme if you have TERM=screen-256color (or specify it somehow
explicitly in a configuration file).

For eix, you can override this by setting TERM_ALT correspondingly
(see the eix manpage; use eix --print TERM_ALT to see the default).

Since you refer particularly to eix-diff: eix-diff had a bug in eix-0.27.1
and did not honour TERM_ALT as documented; this is fixed in >=eix-0.27.2.