Bug 86298 - automatically do color ls if CLICOLOR (or LS_COLORS) are set
automatically do color ls if CLICOLOR (or LS_COLORS) are set
Status: CLOSED CANTFIX
Product: Red Hat Linux
Classification: Retired
Component: coreutils (Show other bugs)
9
All Linux
low Severity medium
: ---
: ---
Assigned To: Tim Waugh
: FutureFeature
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-03-19 00:49 EST by Michael Wardle
Modified: 2007-03-27 00:01 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-01-02 13:23:28 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
automatically produce color output if $CLICOLOR is set (2.02 KB, patch)
2003-03-19 02:29 EST, Michael Wardle
no flags Details | Diff

  None (edit)
Description Michael Wardle 2003-03-19 00:49:02 EST
/etc/profile.d/colorls.csh sets some aliases related to the command "ls".
One of these replaces any instance of "ls" with "ls --color=tty".  This
causes problems when some commands such as "rpm -qf `which ls`" are issued.
Comment 1 Michael Wardle 2003-03-19 02:28:34 EST
I prefer the method employed by FreeBSD, which is to automatically color the
output if the environment variable CLICOLOR is set and the output is a TTY,
negating the need for any shell aliases, which can cause some problems (one of
which I mentioned above).

I have just sent a patch to bug-coreutils to add this functionality to GNU ls.

I will also attach it here in case you would like to adopt it for your package.
Comment 2 Michael Wardle 2003-03-19 02:29:57 EST
Created attachment 90657 [details]
automatically produce color output if $CLICOLOR is set
Comment 3 Michael Wardle 2003-03-19 18:34:57 EST
After reflecting on this, I realize that "which ls" can validly return an
alias rather than a path to an executable file, so this is not strictly a bug.

Still, I like the FreeBSD method, and I'd be happy if you could consider the
attached patch, which should save some amount of mess in login scripts
(/etc/profile.d/ and the like).

You might also note that the provided patch can very easily be modified to
default to color ls if LS_COLORS is set rather than CLICOLOR.
Comment 4 Tim Waugh 2003-04-01 08:41:57 EST
I'll wait and see if it's adopted upstream I think.
Comment 5 Bill Nottingham 2006-08-04 17:32:48 EDT
Red Hat apologizes that these issues have not been resolved yet. We do want to
make sure that no important bugs slip through the cracks.

Red Hat Linux 7.3 and Red Hat Linux 9 are no longer supported by Red Hat, Inc.
They are maintained by the Fedora Legacy project (http://www.fedoralegacy.org/)
for security updates only. If this is a security issue, please reassign to the
'Fedora Legacy' product in bugzilla. Please note that Legacy security update
support for these products will stop on December 31st, 2006.

If this is not a security issue, please check if this issue is still present
in a current Fedora Core release. If so, please change the product and version
to match, and check the box indicating that the requested information has been
provided.

If you are currently still running Red Hat Linux 7.3 or 9, please note that
Fedora Legacy security update support for these products will stop on December
31st, 2006. You are strongly advised to upgrade to a current Fedora Core release
or Red Hat Enterprise Linux or comparable. Some information on which option may
be right for you is available at http://www.redhat.com/rhel/migrate/redhatlinux/.

Any bug still open against Red Hat Linux 7.3 or 9 at the end of 2006 will be
closed 'CANTFIX'. Again, if this bug still exists in a current release, or is a
security issue, please change the product as necessary. We thank you for your
help, and apologize again that we haven't handled these issues to this point.
Comment 7 Bill Nottingham 2007-01-02 13:23:28 EST
Red Hat Linux 7.3 and Red Hat Linux 9 are no longer supported by Red Hat, Inc.
f you are currently still running Red Hat Linux 7.3 or 9, you are strongly
advised to upgrade to a current Fedora Core release or Red Hat Enterprise Linux
or comparable. Some information on which option may be right for you is
available at http://www.redhat.com/rhel/migrate/redhatlinux/.

Closing as CANTFIX.

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