[PATCH 1/6] android: some sensible defconfig changes

Denys Vlasenko vda.linux at googlemail.com
Sun Jun 10 12:46:24 UTC 2012


On Tuesday 29 May 2012 01:35, Rich Felker wrote:
> On Tue, May 29, 2012 at 01:25:40AM +0200, ralda at gmx.de wrote:
> > > - ls --color (default)
> > > +CONFIG_FEATURE_LS_COLOR_IS_DEFAULT=y
> > 
> > This is a bad idea. LS_COLOR_IS_DEFAULT breaks the usage of ls in many
> > shell scripts ... or at least did this in older versions (don't know if
> > newer versions have any workaround for this).
> 
> 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.

> And yes, 
> the breakage is still there, or at least explicit --color affects
> output even if it's not a terminal.

Is this wrong?

-- 
vda


More information about the busybox mailing list