Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 Jun 1996 07:18:16 -0400 (EDT)
From:      rhh@ct.picker.com (Randall Hopper)
To:        kelly@fsl.noaa.gov (Sean Kelly)
Cc:        questions@FreeBSD.org
Subject:   Re: colorls utility
Message-ID:  <199606121118.HAA15326@elmer.picker.com>
In-Reply-To: <199606111438.OAA10101@gatekeeper.fsl.noaa.gov> from "Sean Kelly" at Jun 11, 96 08:38:46 am

next in thread | previous in thread | raw e-mail | index | archive | help
Sean Kelly:
 >>>>>> "Randy" == Randy DuCharme <randyd@nconnect.net> writes:
 >    Randy> Greetings, I've just installed colorls from 2.1 release.  I
 >    Randy> added "alias ls colorls -G" to my .cshrc.  It works fine
 >    Randy> until I do a "ls - <switch> |more.  If I use more I get the
 >    Randy> ANSI escape sequence and not the color.  Is there a way
 >    Randy> around this?
 >
 >I remember someone saying that they modified colorls to check to see
 >if its output is a tty, and only if it is a tty will it output the
 >color sequences.  I don't know if this fix was made, though.

I don't know if the change was was made in the distribution either, but if
you pull the source, this is the patch.  In bin/ls/ls.c, change:

                case 'G':
                        f_color = 1;
                        break;
to:
                case 'G':
                        if ( isatty(1) )
                           f_color = 1;
                        break;

                                       Randall Hopper
                                       rhh@ct.picker.com




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199606121118.HAA15326>