Bug 429121 - Take advantage of 256 color terminals for color ls
Summary: Take advantage of 256 color terminals for color ls
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: coreutils
Version: 8
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Ondrej Vasik
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-01-17 14:34 UTC by dann
Modified: 2012-10-30 14:52 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-02-19 11:21:48 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description dann 2008-01-17 14:34:22 UTC
Description of problem:

Color ls does not take advantage of 256 color terminals, it only uses 16 colors
now. 
A lot of the colors used now are not very readable and plain do not look good.
For an example of how to properly take advantage of 256 color terminals try:

TERM=xterm emacs -nw SOME_FILE.c

and compare the colors used for syntax highlighting with the ones used by:

TERM=xterm-256color emacs -nw SOME_FILE.c


Version-Release number of selected component (if applicable):
coreutils-6.9-12.fc8

Comment 1 Ondrej Vasik 2008-01-17 15:32:23 UTC
Thanks for that new bugzilla ticket- just for clarification:
Would you prefer to have new separate /etc/DIR_COLORS.256colors only with TERMs
with 256 color support and those with 38;5;<color> style? Or to make it somehow
in current DIR_COLORS file? (this will require to create separate color section
for 8 colored and 256 colored TERMs)

Comment 2 dann 2008-01-17 17:45:13 UTC
(In reply to comment #1)
> Thanks for that new bugzilla ticket- just for clarification:
> Would you prefer to have new separate /etc/DIR_COLORS.256colors only with TERMs
> with 256 color support and those with 38;5;<color> style? Or to make it somehow
> in current DIR_COLORS file? (this will require to create separate color section
> for 8 colored and 256 colored TERMs)

IMHO it would be cleaner to have a new /etc/DIR_COLORS.256colors
AFAIK DIR_COLORS does no support conditionals, so separate color sections is not
so easy to implement.

xterm, gnome-terminal, konsole, rxvt and even putty all use the 38;5;<color> style.

What is needed is for someone that has some good artistic/color taste to look at
the 256 colors available and decide which one to use for each type of file. 

Ideally the colors chosen would be very readable on both a white background
(which is the default for most terminals) and a black background (which some
people use).

Comment 3 Ondrej Vasik 2008-01-25 19:59:40 UTC
Added DIR_COLORS file with 256 color support in coreutils-6.10-1.fc9 ... it is
just first attempt of colors, it is not yet reachable from colorls.csh nor
colorls.sh - anyway - those shell scripts needs to be rewritten (because of the
.xterm file is used even from gnome-terminal with black background) - I'm trying
to find suitable solution with usage of terminfo...

Comment 4 Ondrej Vasik 2008-02-04 23:37:48 UTC
coreutils-6.10-5.fc9 RAWHIDE build adds support for 256 colors in colorls.sh/csh
scripts, so should solve your objections... please try it and let me know if it
is usable for F8 update.

Comment 5 dann 2008-02-05 01:06:51 UTC
(In reply to comment #4)
> coreutils-6.10-5.fc9 RAWHIDE build adds support for 256 colors in colorls.sh/csh
> scripts, so should solve your objections... please try it and let me know if it
> is usable for F8 update.

Thanks for doing this! I tried it.

May I suggest using some other color instead of cyan and bright green?
They are not easy to read on a white or light gray background.

For example:
34 instead of bright green (;10)
and
45 instead of cyan (;14)


Comment 6 Ondrej Vasik 2008-02-05 07:17:37 UTC
No problem , thanks for suggestion... will do that in next RAWHIDE build (later
this week, I don't want to make separate build just for that) - at least that
;45 seems to be much better than ;14 on white/light gray background... if you
have other objections(functionality, other better colors), please let me know ...

Comment 7 Ondrej Vasik 2008-02-19 11:21:48 UTC
After thinking a bit more about adding that as update to F8 - I decided to don't
make update with 256-colors DIR_COLORS file for stable F8. 256-colors DIR_COLORS
are built in RAWHIDE and will be shipped with F9. So closing that bugzilla as
NEXT_RELEASE. 

Feel free to add any other suggestions about "better" color codes. They have to
be readable on all basic background colors(white,light gray and black). 

Comment 8 Matteo Settenvini 2012-10-30 14:52:40 UTC
I think it would be important that symlinks have a color different than other files (like .mp3 files, as of now). It's a lot confusing when browsing directories.

AFAIK the default Debian dircolor db isn't bad (uses teal for audio files, purple for images).


Note You need to log in before you can comment on or make changes to this bug.