Summary: | app-portage/eix-0.27.5-r1 - Produces differently coloured output depending on whether it's run as regular user or root. | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | PM <mitaspiotr> |
Component: | Current packages | Assignee: | Martin Väth <martin> |
Status: | RESOLVED DUPLICATE | ||
Severity: | normal | CC: | axs, teidakankan, tomwij |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
See Also: | https://bugs.gentoo.org/show_bug.cgi?id=438076 | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- |
Description
PM
2012-12-05 22:57:35 UTC
I can confirm this. Different output colors 1) from user 2), from root after 'su' 3), from root after 'su -' Also it seems all versions of eix >= 0.25.5 ignore package.keywords file(s). All right from user, but keyworded packages are shown as "will be downgraded" for root (It also visible on screenshots by Piotr Mitas), but it's a subject for another bug. (In reply to comment #1) > Also it seems all versions of eix >= 0.25.5 ignore package.keywords file(s). > All right from user, but keyworded packages are shown as "will be > downgraded" for root (It also visible on screenshots by Piotr Mitas), but > it's a subject for another bug. Where do you see this? On my screenshots the text is the same, only colours differ. I checked with a few -9999 packages I needed to put in package.keywords and eix reports them all correctly as [I], not [D]. (In reply to comment #0) > eix produces differently coloured [...] when ran as root. Are your TERM settings the same before and after the su? If they differ, this is probably the reason: Please report both values here. If the are identical, we have to find which other environment variables differ which are relevant to eix. Try something like this: piotrek$ eix --dump >/tmp/eixuser piotrek$ su - # eix --dump >/tmp/eixroot # diff /tmp/eixuser /tmp/eixroot TERM is xterm in both cases. Here's the diff:
# diff /tmp/eixuser /tmp/eixroot
691,693c691
< COLORFGBG="15;0"
< # changed locally, default was:
< # COLORFGBG=""
---
> COLORFGBG=""
I'm pretty sure I've never touched this variable.
Normally, this variable is set by rxvt or similar terminals and describes there correctly the background color. This is why eix uses it for its background-color heuristics. I cannot test in the moment whether it is set by kterm, but I am absolutely sure that it is not set by xterm (this I had tested). I conjecture that it is set and exported by kde, giving the correct value for kterm but the false value for xterm. If it is only set by kde, this explains also the change in case of "su -": Since it is not set by any shell initialization script and "su -" clears the whole environment, the variable is not set after "su -". The solution for your setting is probably to define in /etc/eixrc: # Dark terminals (without xterm but with kterm) TERM_DARK="linux cygwin putty kterm" # Ignore COLORFBG>B COLORFGBG_DARK= Instead of the latter, I would recommend to configure KDE to export its settings to non-KDE-programms (there was such an option in "systemsettings", but I forgot where): Then your xterm has a black background which is more readable anyway IMHO. Of course, this is up to you... BTW: Do you use kde with default colors? In this case, I should at least include kterm into the TERM_DARK defaults. (In reply to comment #5) > I cannot test in the moment whether it is set by kterm, but I am absolutely > sure that it is not set by xterm (this I had tested). As for xterm, it had the same colours as konsole because I started in from a shell inside konsole and the environment carried over. If I start xterm on it's own, it looks just as konsole after su -. This is a comparison with two versions of eix: http://i.imgur.com/MOlMs.png In konsole the old version looks like the current "regular user look" for both root and regular user. > The solution for your setting is probably to define in /etc/eixrc: > > # Dark terminals (without xterm but with kterm) > TERM_DARK="linux cygwin putty kterm" > # Ignore COLORFBG>B > COLORFGBG_DARK= Is TERM=kterm set by konsole by default? As I said earlier, mine sets TERM=xterm. It could be some leftover from early versions though. Anyway, after changing konsole to export TERM=kterm and adding the TERM_DARK line it works fine now both as regular user an root. > Instead of the latter, I would recommend to configure KDE to export its > settings to non-KDE-programms (there was such an option in "systemsettings", > but I forgot where): Then your xterm has a black background which is > more readable anyway IMHO. Of course, this is up to you... That doesn't matter to me much, I use xterm very rarely. > BTW: Do you use kde with default colors? In this case, I should at least > include kterm into the TERM_DARK defaults. I believe so... If I did change something I did this many years ago and probably wouldn't remember. I do remember that in the days of KDE 3, white background was the default. So we have an explanation of everything: kde exports COLORFGBG correctly, leading to the eix heuristic to work with konsole; after "su -" or starting xterm from konsole the variable is reset resp. kept thus making the eix heuristics fail. Since I do not know a way to improve the heuristic nor the defaults can be changed reasonably (you are right: konsole sets TERM=xterm), I think there is nothing which can be done to improve the situation from the eix side. The main problem remains that the heuristic is very poor... Therefore closing as CANTFIX. (In reply to comment #7) > So we have an explanation of everything: > > kde exports COLORFGBG correctly, leading to the eix heuristic to work > with konsole; after "su -" or starting xterm from konsole the variable > is reset resp. kept thus making the eix heuristics fail. > > Since I do not know a way to improve the heuristic nor the defaults > can be changed reasonably (you are right: konsole sets TERM=xterm), > I think there is nothing which can be done to improve the situation > from the eix side. > > The main problem remains that the heuristic is very poor... > > Therefore closing as CANTFIX. Then why do previous versions not have these color problems? What should users (like me) do to get back the previous behaviour? Since July, I haven't seen this problem till now; so, something must have changed. (In reply to comment #8) > Then why do previous versions not have these color problems? Because they did not use any heuristic to guess the background color: they always assumed black background color which caused other problems. > What should users (like me) do to get back the previous behaviour? This is all explained in the ChangeLog (and in more detail in the man page). In your case you will probably want to put into /etc/eixrc: DARK=true (and e.g. BG1=black to force black background on white xterm; however, this again will lead to other problems e.g. with transparent terminals.) Or use the poor man's color scheme with only 8/16 colors throughout. For simpler reference of both bugs, I mark this now as a duplicate, although it is somewhat a different issue. *** This bug has been marked as a duplicate of bug 438076 *** Let me just add that this solution: DARK=true BG1=black produces no problem whatsoever in transparent Konsole. (In reply to comment #10) > Let me just add that this solution: > DARK=true > BG1=black > produces no problem whatsoever in transparent Konsole. Look at the third screenshot in bug 438076. (And comment to that bug please if you have suggestions how to improve the situation). |