Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
eix colors changed
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2, 3  Next  
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
mv
Watchman
Watchman


Joined: 20 Apr 2005
Posts: 6747

PostPosted: Wed Dec 05, 2012 12:36 pm    Post subject: Reply with quote

frostschutz wrote:
my eyes are bleeding

I guess that you refer to the non-dark schemes 1 or 3. Unfortuntely, these had now become default on most machines since, for some mysterious reason, terminals with white backgroud are what you find on most X desktops.

I was not able to produce a reasonable scheme for white background: Either it becomes unreadable or ugly; and unreadable is not a sane option....

If somebody feels able to produce a reasonable color scheme, please do so and submit...
Back to top
View user's profile Send private message
mitofik
n00b
n00b


Joined: 30 Jan 2010
Posts: 7

PostPosted: Wed Dec 05, 2012 6:32 pm    Post subject: Reply with quote

when few weeks back colours changed to more "neon-like" i didnt care that much. but today eix, besides complaining about commented lines in portage.unmask(?), decided to print everything in grey on my gnome terminal with "white on black" colour profile.
do i really have to set colours for eix? why doesnt it give a crap about my terminal preferences? thats a bit retarded..
i now have 0.27.5
Back to top
View user's profile Send private message
mv
Watchman
Watchman


Joined: 20 Apr 2005
Posts: 6747

PostPosted: Wed Dec 05, 2012 7:29 pm    Post subject: Reply with quote

Since many people ran into this issue: If you use a terminal with black background, you have to tell this to eix: Use
Code:
DARK=true

or, if you use terminals with different backgrounds adapt the regular expresssions in TERM_DARK to your needs.

mitofik wrote:
do i really have to set colours for eix?

Yes; there is no way to get your terminal's background color, so eix can only use a very poor heuristics to "guess" it.

Quote:
why doesnt it give a crap about my terminal preferences?

There is no colorscheme which is well readable on both, black and white, backgrounds (with the 8-bit colors e.g. yellow was hardly readable on white background, and with more colors the problem only increased).

(The mentioned comment issue is a serious regression which will be fixed very soon).
Back to top
View user's profile Send private message
krigstask
n00b
n00b


Joined: 27 Feb 2007
Posts: 41
Location: Rampova, Inkerimaa, Venämaa

PostPosted: Wed Dec 05, 2012 7:48 pm    Post subject: Reply with quote

I think that you've taken a bit wrong approach with those colorschemes. True, there were (I suppose) problems with white-bg'ed terminals, but such users had a problem with eix and were more or less ready to solve it, or had it solved already. Whereas majority (I can't recall light-bg'ed terminal except in SysRescCD) of users just used eix with defaults and *suddenly* it starts to behave differently. That kind of surprises people. Maybe `DARK=true` should be default? Given the problems heuristics causes. Just suggesting :)

Maybe a poll like "What's your teminal's background colour" would help to determine sensible default?
Back to top
View user's profile Send private message
mv
Watchman
Watchman


Joined: 20 Apr 2005
Posts: 6747

PostPosted: Wed Dec 05, 2012 8:16 pm    Post subject: Reply with quote

krigstask wrote:
Whereas majority (I can't recall light-bg'ed terminal except in SysRescCD) of users

In most Terminals under X the default background color is white.
Quote:
Maybe `DARK=true` should be default?

If you look at bug 438076, starting from comment #16 people suggest exactly the opposite: They argue that the default should be "autodetection" to fit as many people as possible. And in fact, in some cases (like on linux terminal or rxvt*) the heuristic is even reliably correct, so this is certainly better than a fixed guess. Of course, it would be nice if the heuristics can be improved, but I see no way how this can be done.
Back to top
View user's profile Send private message
mitofik
n00b
n00b


Joined: 30 Jan 2010
Posts: 7

PostPosted: Wed Dec 05, 2012 9:21 pm    Post subject: Reply with quote

So here's a question
What if i were to use different terminals with different color schemes? ie sometimes i use xterm with default colors but most of the time gnome-terminal with transparent dark background. And $TERM for gnome-terminal is xterm. I'd have to change config in eixrc every time?

I just don't understand why eix shouldn't use color scheme that user of the given terminal specified. If i change default normal text color it changes in all output but eix. If i change default green color to brown it changes everywhere. And by everywhere i mean every portage util (equery), every system util (ls), every editor (vi) that i checked.
what it looks like is that there already is some kind of color management for terminal emulators, so why is eix trying to create another one? why isn't it respecting the user defined configuration?

My concerns aside, i think it is a good idea to give some colors to eix and it's cool that you're looking into making this invaluable utility more intuitive
Back to top
View user's profile Send private message
mv
Watchman
Watchman


Joined: 20 Apr 2005
Posts: 6747

PostPosted: Wed Dec 05, 2012 9:57 pm    Post subject: Reply with quote

mitofik wrote:
What if i were to use different terminals with different color schemes? ie sometimes i use xterm with default colors but most of the time gnome-terminal with transparent dark background. And $TERM for gnome-terminal is xterm. I'd have to change config in eixrc every time?

Then you can use e.g.
Code:
TERM_DARK="linux cygwin putty gnome"

to tell eix that TERM=gnome means for you dark background (but TERM=xterm does not).
Quote:
I just don't understand why eix shouldn't use color scheme that user of the given terminal specified.

Then the colors are restricted to the system colors which are essentially 6 (8 minus black and white). If you want to understand what is going on, look at the output of
Code:
eix --256b

The "standard" colors are those listed in "system colors".
Quote:
If i change default normal text color it changes in all output but eix.

It does if you choose the color scheme 0 or 2 (colorscheme 0 is essentially what eix used before it could use 256 colors). The price you pay for this is that you are down to the few system colors which is a bit poor for the information which eix encodes into colors. So it is nice to have this as a fallback but not good as a default IMHO. I described several times how you can configure eix to use this fallback if you want to.
Quote:
If i change default green color to brown it changes everywhere.

Yes, the default green. And why do you expect that also the other 4-5 types of green which eix uses should be changed by this magically into corresponding brown tones? You would see very strange results if eix would mix system and non-system colors in 256-color-mode: The system green would change but the other greens not.
Quote:
what it looks like is that there already is some kind of color management for terminal emulators

No, there is not: The idea of the 256-color terminals is that the system colors are perhaps changed by the users, but the remaining colors should have more or less fixed rgb-values. Of course you can change any of these 256 values (eix resets them only if you explicitly specify the option --ansi), but if you look at the intended meaning (cf. the mentioned output of eix --256b) you will understand that this is a bad idea.
Back to top
View user's profile Send private message
mitofik
n00b
n00b


Joined: 30 Jan 2010
Posts: 7

PostPosted: Wed Dec 05, 2012 11:59 pm    Post subject: Reply with quote

We could continue this debate and i would say again that gnome-terminal's $TERM is xterm, that there are 16 (14 usable depending on background) colors in so-called 8 color terminal but there's no point in that.
Indeed i finally added
Code:
ALT_TERM=.
COLORSCHEME3=0

and it looks more or _less_ the same as before it was capable of using ever-so-slightly different shades of gray.

So no more whining from me, love eix and cant live w/o it!

Peace
Back to top
View user's profile Send private message
mv
Watchman
Watchman


Joined: 20 Apr 2005
Posts: 6747

PostPosted: Thu Dec 06, 2012 8:06 am    Post subject: Reply with quote

mitofik wrote:
We could continue this debate and i would say again that gnome-terminal's $TERM is xterm

Then I missed you point: You mean that TERM is identical but with different backgrounds in your case?
If there is some environment-variable which is not identical, e.g. assume that GNOME_VAR is set only in your gnome xterm then you could make use of the delayed substittution mechanism:
Code:
DARK='%{??GNOME_VAR}true%{}'

Alternatively, you can export DARK in your shell's startup file appropriately, of course.

Yet another completely different way is to use eix's earlier solution to force the background color:
Code:
BG1=black
BG3=white

Note, however, that this was removed from the defaults, because it led to other unexpected difficulties (e.g. if scrolling is necessary in the terminal, some terminals like xterm fill the scrolled-in line with the current background color which can cause the first line after the eix output to have a "wrong" background color). Moreover, in transparent terms a forced background color can destroy the transparency.
Quote:
that there are 16 (14 usable depending on background) colors in so-called 8 color terminal but there's no point in that.

You mean the bold versions? There is no guarantee that this is implemented by different colors. For instance, bold black and bold white (and all attempts with gray, see an earlier discussion in this thread) turned out to be invisible on rxvt type terminals (with black/white background) so these cannot be used at all. Similarly, background colors (and or color inversion) must be used sparringly since on different terminals the bold/non-bold versions are used for the background and/or foreground, respectively, so practically all combinations are unreadable on some terminal or another (even for the few which I used there were already complains with the solarized scheme, see also in this thread).
Quote:
Indeed i finally added
Code:
ALT_TERM=.
COLORSCHEME3=0

that's why I added it. It is meant to be used if you really need it to work on different terminals.
Quote:
and it looks more or _less_ the same as before

The changes were because of the above mentioned unreadability issues which were reported (or some of which I found by experiments).

Edit: Wrong comment about expansion of DARK removed. Comments about setting BG? added.
Back to top
View user's profile Send private message
mv
Watchman
Watchman


Joined: 20 Apr 2005
Posts: 6747

PostPosted: Fri Dec 07, 2012 7:23 pm    Post subject: Reply with quote

I plan to release a new eix version very soon to make the defaults more to what users had known previously:

The heuristic for DARK=auto now selects DARK=true if in doubt. This hopefully causes less confusion to everybody. (The heuristic now also allows a bit more tweaking, although it is still only based on the values of TERM and COLORFGBG).

If you find time, please test the eix git master from BerliOS (a live ebuild for this repository can be found e.g. in the mv overlay which is available by layman) and report if you have any suggestions, in particular how to improve the heuristics or its defaults.
Back to top
View user's profile Send private message
ichbinsisyphos
Guru
Guru


Joined: 08 Dec 2006
Posts: 547

PostPosted: Sat Dec 08, 2012 6:17 pm    Post subject: Reply with quote

http://ompldr.org/vZ204cg/eix-colors.png
This is what I am getting. Above is DARK="true", the one below is the default. DARK="true" is definitely better readable on a black background, but these are completely weird alien colors.

In one of the earlier versions the background was painted gray, making most of the output totally unreadable :)

I find it hard to make much sense of the config options written here right now, will try them out this evening. I don't think that I am adding anything new to the discussion with this post, but I'd like to say that personally I would prefer if the color scheme is more similar to what we are familiar with from emerge for example. Or is emerge using the .Xdefaults?
Back to top
View user's profile Send private message
mv
Watchman
Watchman


Joined: 20 Apr 2005
Posts: 6747

PostPosted: Sat Dec 08, 2012 7:27 pm    Post subject: Reply with quote

ichbinsisyphos wrote:
This is what I am getting.

Looks like you are getting 256-color output on a terminal which is capable of only 88 colors (or less). Which terminal are you actually using and what is your value of TERM?
(Also: which eix version are you using? In case you use rxvt-unicode eix-0.27.5 should have fixed it, although I would recommend to emerge rxvt-unicode with the 256-color USE-flag instead which improves the output.
Quote:
personally I would prefer if the color scheme is more similar to what we are familiar with from emerge for example.

The color schemes for dark background are intentionally very similar to emerge (if they are displayed as they should which apparently is not the case for you and needs to be fixed).
For white background, I did not suceed to do this because of readability issues (as already mentioned, I have extreme problems with white background - I cannot look at it for longer without getting a headache, so I do not want to spend time to optimize it; somebody else must step up for this if it is really desired).
Back to top
View user's profile Send private message
ichbinsisyphos
Guru
Guru


Joined: 08 Dec 2006
Posts: 547

PostPosted: Sat Dec 08, 2012 7:52 pm    Post subject: Reply with quote

mv wrote:
... I would recommend to emerge rxvt-unicode with the 256-color USE-flag...
Ahh, ok. This look I can definitely get used to. Thanks a lot.

Yes, I am using rxvt-unicode with (~)eix-0.27.5-r1

edit:
mv wrote:
... Which terminal are you actually using and what is your value of TERM? ...

This makes a difference too, TERM was "rxvt", with "rxvt-unicode" it is really the emerge-look.

http://ompldr.org/vZ21hbg/eix-color.png
Back to top
View user's profile Send private message
mv
Watchman
Watchman


Joined: 20 Apr 2005
Posts: 6747

PostPosted: Sat Dec 08, 2012 8:41 pm    Post subject: Reply with quote

ichbinsisyphos wrote:
This makes a difference too, TERM was "rxvt", with "rxvt-unicode" it is really the emerge-look.

How did you manage to get TERM=rxvt for rxvt-unicode? Have you set it explicitly somewhere? AFAIK rxvt-unicode sets only TERM=rxvt-unicode or TERM=rxvt-unicode-256color, respectively. If you set it manually, is there a good reason to do so? (In this case, maybe eix should treat TERM=rxvt as non-256colors, although this is a bit strange, because x11-terms/rxvt can display 256 colors).
Back to top
View user's profile Send private message
ichbinsisyphos
Guru
Guru


Joined: 08 Dec 2006
Posts: 547

PostPosted: Sat Dec 08, 2012 8:55 pm    Post subject: Reply with quote

No, I never set it anywhere manually (before), it just is "rxvt", without "-unicode" here by default. God knows why.

Btw, if I export TERM="rxvt-unicode-256color/s", eix looks exactly like with TERM="rxvt" ...
Back to top
View user's profile Send private message
mv
Watchman
Watchman


Joined: 20 Apr 2005
Posts: 6747

PostPosted: Sun Dec 09, 2012 10:34 am    Post subject: Reply with quote

ichbinsisyphos wrote:
Btw, if I export TERM="rxvt-unicode-256color/s", eix looks exactly like with TERM="rxvt" ...

Yes, this is the intention: If *-256colors is specified it is clear that 256 colors are supported, and so far I thought that the same is the case with (only) rxvt. Guess I will remove this assumption (although this means that x11-terms/rxvt will only use system colors unless the user set TERM=rxvt-256colors
Back to top
View user's profile Send private message
sligo
Tux's lil' helper
Tux's lil' helper


Joined: 17 Oct 2011
Posts: 93

PostPosted: Mon Dec 10, 2012 8:52 pm    Post subject: Reply with quote

just updated eix today and it started to look strange again. i figured, i've changed my terminal (xfce terminal called "terminal") colors to "tango scheme" a long time ago and forgot about it. the "tango scheme" is the one ubuntu is using on their terminals. i use mc allot and the default colors have a pretty heavy coloring on such fullscreen terminal apps like mc. so i've switched it to the ubuntu (tango) scheme, as it looks very nice to me.

since eix started to overwrite the colorsettings it seems to use the default scheme and this is what looks strange in the end.

this is one thing.

the other thing is, that my terminal runs with a transparent (70%) black background but eix started to use a non transparent background as of today. beside the coloring, this is what looks additionally strange now.

i've changed my settings to TERM="" last time. This didn't worked out to well in the end. Which one is the correct one to get the 8 colors to default?
Back to top
View user's profile Send private message
mv
Watchman
Watchman


Joined: 20 Apr 2005
Posts: 6747

PostPosted: Mon Dec 10, 2012 10:03 pm    Post subject: Reply with quote

Please read the bugs section on the eix manpage.
It is described there how to avoid forcing (or force) the background (e.g. for transparent terminals).
It is described there how to force 8-colors everywhere.
It is described there how to fix things if your background color is wrongly detected.
It is described there how to fix things if your number of colors is wrongly detected.
Back to top
View user's profile Send private message
sligo
Tux's lil' helper
Tux's lil' helper


Joined: 17 Oct 2011
Posts: 93

PostPosted: Mon Dec 10, 2012 11:19 pm    Post subject: Reply with quote

sorry, should have known. fixed it. thanks again for your work!
Back to top
View user's profile Send private message
krigstask
n00b
n00b


Joined: 27 Feb 2007
Posts: 41
Location: Rampova, Inkerimaa, Venämaa

PostPosted: Sat Dec 15, 2012 2:26 pm    Post subject: Reply with quote

I try to make use of the following setup:
Code:

   ~/.Xresources:
URxvt*termName: rxvt-unicode

   /etc/eixrc:
DARK=true
TERM_ALT3_ADD=rxvt-unicode

This should be just the case described in manpage:
Quote:
EXAMPLE 2: If you want to tell eix that TERM=rxvt means a 256 color
terminal, set TERM_ALT1_ADD=rxvt. (This is no longer the default,
because there are rxvt versions which support only 88 colors and set
TERM=rxvt; thus assuming 256 colors would produce completely broken
colors.)


But I can't make eix display in 256-colour dark colourscheme, while `TERM="rxvt-unicode-256color" eix ...` works as intended. Do I miss anything?
Back to top
View user's profile Send private message
mv
Watchman
Watchman


Joined: 20 Apr 2005
Posts: 6747

PostPosted: Sun Dec 16, 2012 8:10 am    Post subject: Reply with quote

krigstask wrote:
Code:
TERM_ALT3_ADD=rxvt-unicode

This should be just the case described in manpage:
Quote:
TERM_ALT1_ADD=rxvt.

The 256 color terminals are meant to be matched by TERM_ALT1 (TERM_ALT3 is meant to be set by the user e.g. for "global" changing to 8 colors). For this reason, TERM_ALT3_ADD has by default no meaning for eix: The default definition of the variables is
Code:
$ eix --dump|grep TERM_ALT.=
TERM_ALT1="256 [aeEkx]term konsole gnome putty %{TERM_ALT1_ADD}"
TERM_ALT2="88 rxvt-unicode[^2]*\$ %{TERM_ALT2_ADD}"
TERM_ALT3=""

Note that replacing "3" by "1" in your approach would not work, because rxvt-unicode is matched by TERM_ALT2 which takes precedence over TERM_ALT1.
The "correct" solution would be to set your actual terminal type which is in your case TERM="rxvt-unicode-256color".
If you cannot do this for some reason (BTW: Which terminal are you using? x11-terms/rxvt-unicode exports the correct TERM, i.e. TERM=rxvt-unicode-256color if compiled with USE=256colors and TERM=rxvt-unicode if it can display only 88 colors), you can workaround it by settting TERM_ALT2="" or, as you perhaps intended,
Code:
TERM_ALT3=rxvt-unicde
COLORSCHEME3="1 3"

(note that you must set the colorscheme for TERM_ALT3, since the default would be the 8-color scheme).

BTW: For rxvt type terminals, you do not need to set DARK, since these terminals usually set COLORFGBG so that the default heuristic of eix should determine the background color correctly.
Back to top
View user's profile Send private message
krigstask
n00b
n00b


Joined: 27 Feb 2007
Posts: 41
Location: Rampova, Inkerimaa, Venämaa

PostPosted: Sun Dec 16, 2012 9:13 am    Post subject: Reply with quote

Thanks for clarification, now it works as intended.

1. I happen to copypaste eixrc when TERM_ALT3_ADD was set (after a bit of trying to set this and that vars), but TERM_ALT1_ADD didn't work either, just as you pointed it.
2. I specifically enforce TERM="rxvt-unicode" because I'm really tired of getting "Unknown terminal" errors when SSHing to most remote hosts
3. If I omit DARK=true, eix enforces white background for its output, but that's probably to my weird urxvt configuration.
Back to top
View user's profile Send private message
mv
Watchman
Watchman


Joined: 20 Apr 2005
Posts: 6747

PostPosted: Sun Dec 16, 2012 10:55 am    Post subject: Reply with quote

krigstask wrote:
2. I specifically enforce TERM="rxvt-unicode" because I'm really tired of getting "Unknown terminal" errors when SSHing to most remote hosts

I recommend to either write a ssh wrapper or - if possible even better - a .login/.bashrc/.whatever on the remote host(s) which (re)sets TERM to a value known to the machine.
Quote:
3. If I omit DARK=true, eix enforces white background for its output, but that's probably to my weird urxvt configuration.

Maybe this is related: If you use "su -" (or equivalent sudo) COLORFGBG is forgotten so that the heuristic fails again. For sudo you might want to configure it that COLORFGBG is kept.
Back to top
View user's profile Send private message
krigstask
n00b
n00b


Joined: 27 Feb 2007
Posts: 41
Location: Rampova, Inkerimaa, Venämaa

PostPosted: Sat Dec 22, 2012 4:30 pm    Post subject: Reply with quote

mv wrote:
krigstask wrote:
2. I specifically enforce TERM="rxvt-unicode" because I'm really tired of getting "Unknown terminal" errors when SSHing to most remote hosts

I recommend to either write a ssh wrapper or - if possible even better - a .login/.bashrc/.whatever on the remote host(s) which (re)sets TERM to a value known to the machine.

These ways seem kludgy to me. Enforcing $TERM isn't a whole lot better, of course...
Quote:
Quote:
3. If I omit DARK=true, eix enforces white background for its output, but that's probably to my weird urxvt configuration.

Maybe this is related: If you use "su -" (or equivalent sudo) COLORFGBG is forgotten so that the heuristic fails again. For sudo you might want to configure it that COLORFGBG is kept.

Nope, it's just regular "login to X, start urxvt, run eix" scenario.

Also I had to set `BG1=none` to get rid of eix enforcing black background, thus spoiling my pseudotransparency.


Last edited by krigstask on Mon Dec 24, 2012 3:48 pm; edited 1 time in total
Back to top
View user's profile Send private message
mv
Watchman
Watchman


Joined: 20 Apr 2005
Posts: 6747

PostPosted: Mon Dec 24, 2012 3:35 pm    Post subject: Reply with quote

krigstask wrote:
mv wrote:
krigstask wrote:
2. I specifically enforce TERM="rxvt-unicode" because I'm really tired of getting "Unknown terminal" errors when SSHing to most remote hosts

I recommend to either write a ssh wrapper or - if possible even better - a .login/.bashrc/.whatever on the remote host(s) which (re)sets TERM to a value known to the machine.

These ways seem kludgy to me.

Having remote hosts which have ancient ncurses versions and thus do not know current TERM settings is kludgy. Thus to workaround this "bug" in the corresponding startup script on the machine (by setting to a wrong but at least recognized TERM) is probably the best which can be done.
Quote:
Nope, it's just regular "login to X, start urxvt, run eix" scenario.

What does echo $COLORFGBG output? If it outputs nothing, it is presumably unset in some of your startup scripts - this should be avoided.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Goto page Previous  1, 2, 3  Next
Page 2 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum