Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 04 Jun 2000 16:34:27 -0700
From:      Doug Barton <DougB@gorean.org>
To:        Robert Watson <rwatson@FreeBSD.ORG>
Cc:        Warner Losh <imp@village.org>, "Matthew N. Dodd" <winter@jurai.net>, cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG, Josef Karthauser <joe@pavilion.net>
Subject:   Re: cvs commit: src/bin/ls extern.h ls.1 ls.c ls.h print.c
Message-ID:  <393AE783.2C6FA3A8@gorean.org>
References:  <Pine.NEB.3.96L.1000604191852.8938A-100000@fledge.watson.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Robert Watson wrote:
> 
> On Sun, 4 Jun 2000, Doug Barton wrote:
> 
> > 3. First choice for 'ls -G' should be tgetstr(), with the ANSI codes
> > left in as a fallback if that returns NULL. (Thus handling the case of
> > no mounted /usr as well as possible.)
> 
> Forgive me my ignorance here -- the only situation I can imagine where
> using hard-coded color codes would be appropriate would be where termcap
> is not available, but a known-good terminal type is available via
> getenv("TERM"). 

	Fundamentally, I agree with you. But see below.
 
> So this leads me to the obvious question: if terminal information is not
> available, why would we want to print out color codes?  Is it not
> acceptable to just not print in color when in single-user mode, or if the
> termcap database is unavailable?

	Acceptable, sure, but not really necessary. The ANSI codes work for the
majority of "terminals," including cons25. Since the user has to
explicitly enable the option to display color, if for some odd reason
(most likely a serial console) the fallback ANSI codes don't work, they
can just disable color. Think about it this way. Which is going to cause
the most -questions e-mails? "Why doesn't my color ls work in single
user mode?" or "Why doesn't my color ls work when I use my 20 year old
Wyse 50 hooked up as a serial console?"

Doug
-- 
        "Live free or die"
		- State motto of my ancestral homeland, New Hampshire

	Do YOU Yahoo!?


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?393AE783.2C6FA3A8>