www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/12/19/11:25:32

Date: Thu, 19 Dec 1996 18:07:18 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Bill Davidson <bdavidson AT ra DOT isisnet DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: color ls
In-Reply-To: <59ajbs$m37$1@thor.atcon.com>
Message-ID: <Pine.SUN.3.91.961219175731.25806G-100000@is>
MIME-Version: 1.0

On Thu, 19 Dec 1996, Bill Davidson wrote:

> Actually, the nice part of the linux ls:
> (plato:~$ ls --version
> GNU fileutils 3.12 with color-ls patch 3.12.0.2 )
> is that it takes its default options from an environment variable
> LS_OPTIONS; it doesn't use color by default unless --color=<yes|tty] is
> set in LS_OPTIONS (just checked to make sure).

See that ``with color-ls patch'' above?  That's the Linux-specific 
patches I was talking about.  Fileutils 3.14 is out, but I didn't look 
inside yet to see if there is a change along the above lines.

> > IMHO, making the color be used by default will do trouble on MSDOS if and
> > when you use any of the programs that catch DOS output by installing an
> > Int 21h hook (like some editors which allow you to compile without
> > exiting the editing session).  I'm sure though that this was NOT the
> 
> Will the --color=tty fix that, or would an int 21h hook still look like
> a terminal to ls?

Of course, it looks like a tty; ls doesn't even know that Int 21h is 
hooked by its parent.

> I must try this in my DOS emacs,

Emacs doesn't hook Int 21h, it just redirects stdout and stderr, and so
the DOS port of ls doesn't use the color (even if you say --color) because
it checks with `isatty'.  But the redirection means that while ls runs,
you are blind, you just sit and wait for it to finish before you see any
of the output.  Other editors make better job here: they let you see the
output as if you were running ls from the DOS prompt, but also catch that
output by hooking Int 21h and insert it into a buffer when ls exits and
you are back in the editor.  (This might not seem like a big deal when you
run ls, but think about running Make which builds a large package: if you
see error messages, you might just Ctrl-C to abort Make, but with the
redirection thing, you must wait until Make decides to give up.)

> but then I could
> always use --color=no from inside emacs.

That's a nuisance, IMHO, since there are versions of ls which don't 
understand this option and will barf.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019