[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: color ls (fwd)



Jim Meyering responded:

> | This come to via debian mailing list and is about how to activate
> | color support for ls.  I think the default should be no color at
> | all but I doubt if so much aliases as in the message below are the
> | proper way to activate color support.  Can't this be done in a much
> | easier way, for example by checking if LS_COLOR has a value (then
> | color) or does not exist or is empty (then no color).
> 
> You're right.  It would be better not to alias at all
> when the eval sets LS_COLORS to the empty string. (but see below)
> So you (Dirk) could bracket his aliases with
> 
> if test -n "$LS_COLORS"; then
>   alias ...
> fi
> 
> | Dirk Eddelb"uttel writes:
> | > The old dircolors created the LS_COLORS env variable with your colour
> | > selection the default or specified rc file _and_ created the aliases.
> | >
> | > Now it only builds LS_COLORS so that I changed the code in
> | > /usr/local/etc/profile (which I source from /etc/profile) to
> | >
> | >     eval `dircolors -b /usr/local/etc/colour-ls.rc`
> | >     alias ls='ls --color=auto ';
> | >     alias dir='ls --color=auto --format=vertical';
> | >     alias vdir='ls --color=auto --format=long';
> | >     alias d=dir;
> | >     alias v=vdir;
> | >     alias ols='/bin/ls '
> 
> Personally, I think it is bad to impose such common and short-named
> aliases on all users.  They will cause confusion in many users because
> they'll conflict with aliases/functions users had before they switched
> to debian.  That's why I removed the alias-setting `feature' of the
> slackware dircolors -- in addition, trying to accomodate 4-5 different
> shell syntaxes made the program unnecessarily (IMHO) complex.
> 
> | > Before, I only needed the "eval 'dircolors -b <resourcefile>`" line and the
> | > aliases were built automagically (the format was slightly different, though,
> | > there was also --8-bit or some such).
> | >
> | >   Mark> What is the problem?  I've changed a number of things of late - moved
> | >   Mark> from tcsh to bash (but same thing happens in both shells), and
> | >   Mark> upgraded a number of packages.  So I don't know what has caused the
> | >   Mark> change.  Any ideas anyone?
> | >
> | > Your upgrade to the newest fileutils package which replaced the now redundant
> | > color-ls package.
> | >
> | > Erick, is there a way that you can persuade/hack dircolors to do what the old
> | > one did? Or put a note in the package to ease transition?
> |
> | What about it Jim?
> 
> I'll put a note in the info documentation for dircolors on how to
> do those things.
 



Reply to: