Bug 239501

Summary: Colors are too dark
Product: [Fedora] Fedora Reporter: Simon Perreault <nomis80>
Component: coreutilsAssignee: Ondrej Vasik <ovasik>
Status: CLOSED WORKSFORME QA Contact:
Severity: low Docs Contact:
Priority: medium    
Version: 9CC: akos.ladanyi, bbenson, kdudka, meyering
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-08-06 05:42:30 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Bug Depends On:    
Bug Blocks: 235704    

Description Simon Perreault 2007-05-08 19:12:39 EDT
Steps to reproduce:
Type "ls /"
  
Actual results:
Directory colors are dark blue.

Expected results:
Directory colors are light blue.

Additional info:
To fix this problem I simply "rm /etc/DIR_COLORS.xterm". IIRC, this change 
happened in Red Hat 8 and had to do with Unicode. Other file types are too 
dark.
Comment 1 Simon Perreault 2007-05-08 19:13:32 EDT
I meant "Other file type are *also* too dark."
Comment 2 Akos Ladanyi 2007-08-31 17:15:33 EDT
The problem is that if you use a gnome terminal with dark background, then the
dark blue directory names can be barely seen.

This is caused by /etc/DIR_COLORS.xterm file. This was introduced to disable the
bold texts in xterm, which are hard to read there.

However it also messes up gnome terminal, because gnome terminal sets $TERM to
xterm too, so it uses DIR_COLORS.xterm instead of DIR_COLORS.
Comment 3 Ondrej Vasik 2008-01-19 10:09:16 EST
Sorry for late response, changing version to devel, as it is not the thing which
needs to be fixed in specific release and has still the same behaviour in rawhide.

I understand what you want, but the reason why DIR_COLORS.xterm was added is
that bright colors are hard to read on white/light gray xterm background. So
changing colors back to bright colors by default in DIR_COLORS.xterm will bring
up another bugzilla ticket (for example you could read #161711 about the other
side). 

So if you are sure that you want only dark background, you have several
posibilities.
1) To edit /etc/DIR_COLORS.xterm manually - main change between DIR_COLORS and
DIR_COLORS.xterm is usage of bold characters(.xterm version doesn't use bold) -
so if you change the first number 00 in DIR section to 01 you will have
directories bright blue.
2) to remove DIR_COLORS.xterm - as you wrote in description of problem, but is
not good idea to do that generally
3) to remove (comment out) line with /etc/DIR_COLORS.$TERM in
colorls.sh/colorls.csh script (depends on the shell you are using) - same as #2

But as I said - to not use bold (and therefore more bright) colors in
DIR_COLORS.xterm is expected behaviour and not a bug. So closing this one
bugzilla NOTABUG, but I will find out how to solve it because of newer bugzilla
#429121 (will need better .sh/csh scripts to handle 256-colored output choice).
Comment 4 Simon Perreault 2008-01-19 15:23:25 EST
Well, this does explain the issue but it is still a bug. The bug now is that
/etc/DIR_COLORS.xterm is used when logging in on the plain console (i.e. not
even using X). It seems to me that /etc/DIR_COLORS should be used instead.
Comment 5 Ondrej Vasik 2008-04-17 08:44:45 EDT
Sorry for longer response, I missed that reopened bug somehow. When you are
using text mode console (without X), TERM envvar is(or should be usually) linux
- therefore /etc/DIR_COLORS is used. When you use gnome-terminal TERM envvar is
unfortunately xterm (and I don't know about any easy way how to get information
which color of background I'm using which could be used in
/etc/profile.d/colorls.sh script). Therefore /etc/DIR_COLORS.xterm (which is
provided because of the request of xterm users) is used. You always could use
dir_colors file in your home - and this one will be used instead of the system
provided one and you can easily modify it. The easy solution for gnome-terminal
could be to persuade gnome-terminal maintainer to use different TERM envvar -
but this could break other things. Feel free to give me any idea how to solve it
different way (I'm not going to remove /etc/DIR_COLORS.xterm from the fedora
coreutils package, so don't recommend this one idea).
Comment 6 Simon Perreault 2008-04-21 09:33:58 EDT
No, please, you don't understand.

The colors are too dark both in X *and* in the regular Linux console. Forget
about my proposed fix, which is stupid. First acknowledge that the problem exists.

This was widely reported in distribution reviews when Red Hat Linux 8 came out a
long time ago but obviously it's long been forgotten. The colors were brighter
in RHL7, and much more readable. If you must see it to understand, you can just
install one in a VMware, you'll quickly see the difference.

IIRC, the change was due to the big UTF-8 change that occurred from RHL7 to
RHL8. The color change was needed but unfortunate. It's probably not needed anymore.
Comment 7 Bug Zapper 2008-05-13 22:52:35 EDT
Changing version to '9' as part of upcoming Fedora 9 GA.
More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 8 Kamil Dudka 2008-08-01 06:17:10 EDT
Some kind of background detection is implemented in vim. It is not real 
detection but only "guessing" from terminal name and environment variable. See 
the function term_bg_default() in module option.c:
/*
 * Return "dark" or "light" depending on the kind of terminal.
 * This is just guessing!  Recognized are:
 * "linux"          Linux console
 * "screen.linux"   Linux console with screen
 * "cygwin"         Cygwin shell
 * "putty"          Putty program
 * We also check the COLORFGBG environment variable, which is set by
 * rxvt and derivatives. This variable contains either two or three
 * values separated by semicolons; we want the last value in either
 * case. If this value is 0-6 or 8, our background is dark.
 */

I can try to take this "detection" from vim sources, but it will take some time.
Comment 9 Simon Perreault 2008-08-01 08:24:06 EDT
You don't need to do any detection. Only playing with /etc/DIR_COLORS* is
sufficient.
Comment 10 Kamil Dudka 2008-08-06 05:09:02 EDT
Which terminal are you currently using?

xterm, gnome-terminal and rxvt use light background by default. If you have changed the background color, you need to update $HOME/.dircolors. Try

cp /etc/DIR_COLORS $HOME/.dircolors

for terminal with dark background.
Comment 11 Simon Perreault 2008-08-06 05:22:03 EDT
See above. I mentioned several times that this affects the plain console (i.e. not even using X).
Comment 12 Kamil Dudka 2008-08-06 05:42:30 EDT
(In reply to comment #11)
> See above. I mentioned several times that this affects the plain console (i.e.
> not even using X).
I can't see any problem in native console - tested on sane F-9 installation. Did you try it with the clean profile? Make sure you have original /etc/DIR_COLORS.

In the report you wrote "rm /etc/DIR_COLORS.xterm" fixes the problem, but this file is not used for native console. Have you changed /etc/profile.d/colorls.(c)sh?
Comment 13 Bruce O. Benson 2014-05-15 16:53:06 EDT
Yeah, too dark.