Re: ls -color on dumb terminals
Shmyrev <[email protected]> (by way of Shmyrev <[email protected]>) (by way of Shmyrev <[email protected]>) Thu, 27 Feb 2003 22:25:38 +0300
| Newsgroups | gmane.comp.gnu.fileutils.bugs |
|---|---|
| Organization | NIISI |
| Message-ID | <[email protected]> |
>Could you be more specific please? I could not locate anything
>relevant.
http://mail.gnu.org/archive/html/bug-fileutils/2001-01/msg00014.html
>Excuse me? /etc/DIR_COLORS? GNU fileutils does not include any file
>/etc/DIR_COLORS. ls -l /etc/DIR_COLORS
In RedHat it is /etc/DIR_COLORS, in GNU fileutils it is src/dircolors.hin.
> GNU fileutils does not include any user aliases. User aliases are by
>definition a user defined configuration. If you don't want any
>aliases then don't define any.
Unless that I could use ls --color=auto.
At all.
There is command in fileutils that parse dircolors.hin and returns LS_COLORS
setup script. Many distributions use it. When therminal is dumb, dircolors
sets this environment variable to ''. But in ls if LS_COLORS='' color
indicators take their default value. And ls colors text as default.
The only check on this way in current time is check for isatty
/* Using --color with no argument is equivalent to using
--color=always. */
i = color_always;
print_with_color = (i == color_always
|| (i == color_if_tty
&& isatty (STDOUT_FILENO)));
I suppose, you must add
/* Using --color with no argument is equivalent to using
--color=always. */
i = color_always;
print_with_color = (i == color_always
|| (i == color_if_tty
&& isatty (STDOUT_FILENO))
&&(*getenv("LS_COLORS") != 0 ));
Thanks for attention.