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

Re: less and color



> On 26/1/2000 <ljh@mail.net-labs.com> wrote:
> 
> >I have setup the ls command to use the display color option using an
> >alias.  It works fine.  Colors are also displayed nicely when piping
> >ls stdout to the more command.  I want to use less instead of
> >more.  However, when piping ls stdout to the less command, less displays
> >the directory listing in b/w and with control characters (escape seq with
> >hex numbers?) around the filenames instead of just using the correct
> >colors.
> >
> >Has anyone out there fixed this problem?  I have tried changing the
> >LESSCHARSET env. variable with no luck.  Advice or tips would be
> >appreciated.  I should mention that I am using the console with
> >$TERM=linux.
> 
> for this reason and others such as redirecting ls output to a file i 
> have set my alias to ls -l --color=auto which will cause normal non 
> color listings when output goes anywhere but a tty.
> 

Then ls is sensing its output device and works accordingly? How does it do 
that?



Reply to: