Bug 239266

Summary: 'ls' output is not in color with xterm-256color
Product: [Fedora] Fedora Reporter: Leo <sdl.web>
Component: coreutilsAssignee: Ondrej Vasik <ovasik>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: dickey, meyering, mlichvar
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-01-17 06:02:07 EST 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 Leo 2007-05-07 04:56:34 EDT
Description of problem:
I have set the resource "XTerm.termName: xterm-256color". Now `ls` output in
xterm is always in black and white, no colors at all. However if I start another
xterm with "xterm -tn xterm" (i.e. use the default 8-color term), `ls' output
has colors.

Version-Release number of selected component (if applicable):
xterm-225-2.fc7

How reproducible:
100%

Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:
Comment 1 Miroslav Lichvar 2007-05-07 05:39:43 EDT
dircolors don't know about xterm-256color, an extra entry in /etc/DIR_COLORS*
would be needed to have this working.

Also would be nice to have an entry for rxvt-unicode terminal.
Comment 2 Jim Meyering 2007-05-07 05:53:02 EDT
Thanks for the report. This was fixed in coreutils-6.0. rawhide is at coreutils-6.9.

  $ /usr/bin/dircolors --p|grep -E uni\|256
  TERM rxvt-unicode
  TERM xterm-256color
  $ /usr/bin/dircolors --ver|head -1
  dircolors (GNU coreutils) 6.9
Comment 3 Leo 2007-05-07 06:28:04 EDT
(In reply to comment #2)
> Thanks for the report. This was fixed in coreutils-6.0. rawhide is at
coreutils-6.9.
> 
>   $ /usr/bin/dircolors --p|grep -E uni\|256
>   TERM rxvt-unicode
>   TERM xterm-256color
>   $ /usr/bin/dircolors --ver|head -1
>   dircolors (GNU coreutils) 6.9

Does that mean you can't reproduce this bug?
Comment 4 Miroslav Lichvar 2007-05-07 06:39:48 EDT
/etc/profile.d/colorls.* don't use the precompiled database, so /etc/DIR_COLORS
needs to be updated.
Comment 5 Jim Meyering 2007-05-07 07:23:48 EDT
Ah.  I see what you mean.  If there is a good reason to maintain /etc/DIR_COLORS
separately from the database that is printed by dircolors -p, then it would be
nice to generate it, so that they stay in sync.  Tim, if you're interested, I'm
sure we can merge things so that it can be generated -- or even identical to the
built-in DB.  Ideally, /etc/profile.d/* would use something like this:
  eval "`dircolors`"
by default.
Comment 6 Tim Waugh 2007-05-08 05:56:17 EDT
Oh, maybe the spec file should generate DIR_COLORS at build time -- is that what
you mean?
Comment 7 Jim Meyering 2007-05-08 06:05:49 EDT
That's a good first step.  In addition, if the shell snippets in
/etc/profile.d/* were to use eval "`dircolors --whatever`" (and not use
/etc/DIR_COLORS anymore), then they would work also with older and newer
versions of ls/dircolors, rather than just with the system-installed versions.
Comment 8 Leo 2007-05-22 12:14:19 EDT
To work around the bug before a fixed coreutils is available:

dircolors -p > ~/.dir_colors
Comment 9 Leo 2007-05-29 07:17:04 EDT
Please also support "screen-256color" along with term-256color and rxvt-unicode.
Comment 10 Leo 2007-05-29 07:17:47 EDT
(In reply to comment #9)
> Please also support "screen-256color" along with term-256color and rxvt-unicode.
                                                   ^ read 'xterm-256color'
Comment 11 Thomas E. Dickey 2007-06-12 09:29:18 EDT
It would be nice if dircolors used terminfo or termcap
rather than a set of hardcoded values which are a nuisance to
everyone else.
Comment 12 Leo 2008-01-16 15:42:21 EST
Has this bug been forgotten? I would love to see it fixed in Fedora 9.
Comment 13 Ondrej Vasik 2008-01-17 06:02:07 EST
Yes and no. As you can see in changelog(rawhide, 6.9-12.fc9) I ported upstream
supported dircolors to dircolors.hin file - but this was not enough because
shipped DIR_COLORS and DIR_COLORS.xterm are not generated automatically and have
to be modified manually. Unfortunately - I forgot to do that in that build. Now
added and built as coreutils-6.9-17.fc9. Closing RAWHIDE, feel free to reopen it
if adding requested TERMs to DIR_COLORS and DIR_COLORS.xterm is not sufficient
for you.

Anyway - even this bugzilla got closed I will think about generating those
DIR_COLORS files at build time - maybe at least DIR_COLORS file could be
generated from dircolors.hin which provides (hopefully) complete list of colored
TERMs supported by ls.
Comment 14 Leo 2008-01-17 11:22:43 EST
Thank you for working on fixing this.

Is it possible to push the update for F8?