On Sun, Jun 10, 2012 at 02:46:24PM +0200, Denys Vlasenko wrote:
> > The proper use of color-ls-by-default is with a shell alias; IMO this
> > option should be removed from busybox since it's so broken.
>
> Why is it broken?
>
> if (ENABLE_FEATURE_LS_COLOR_IS_DEFAULT && isatty(STDOUT_FILENO)) {
> char *p = getenv("LS_COLORS");
> /* LS_COLORS is unset, or (not empty && not "none") ? */
> if (!p || (p[0] && strcmp(p, "none") != 0))
> G_show_color = 1;
> }
>
> As you see, color will be auto-enabled only for tty output.
OK.
> > And yes,
> > the breakage is still there, or at least explicit --color affects
> > output even if it's not a terminal.
>
> Is this wrong?
No; I just wrongly assumed ENABLE_FEATURE_LS_COLOR_IS_DEFAULT meant
that --color was implicitly enabled by default, and so I tested
--color to see the behavior. Since they're separate, you can ignore my
report.
I still think shell aliases are a better way of handling ls
preferences, however.
Rich
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox