From owner-cvs-all Sun Jun 4 16:34:37 2000 Delivered-To: cvs-all@freebsd.org Received: from dt051n0b.san.rr.com (dt051n0b.san.rr.com [204.210.32.11]) by hub.freebsd.org (Postfix) with ESMTP id 9E7AA37B829; Sun, 4 Jun 2000 16:34:28 -0700 (PDT) (envelope-from DougB@gorean.org) Received: from gorean.org (doug@master [10.0.0.2]) by dt051n0b.san.rr.com (8.9.3/8.9.3) with ESMTP id QAA70316; Sun, 4 Jun 2000 16:34:28 -0700 (PDT) (envelope-from DougB@gorean.org) Message-ID: <393AE783.2C6FA3A8@gorean.org> Date: Sun, 04 Jun 2000 16:34:27 -0700 From: Doug Barton Organization: Triborough Bridge & Tunnel Authority X-Mailer: Mozilla 4.72 [en] (X11; U; FreeBSD 5.0-CURRENT-0603 i386) X-Accept-Language: en MIME-Version: 1.0 To: Robert Watson Cc: Warner Losh , "Matthew N. Dodd" , cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG, Josef Karthauser Subject: Re: cvs commit: src/bin/ls extern.h ls.1 ls.c ls.h print.c References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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