From owner-freebsd-arch Mon Oct 21 0:16:10 2002 Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7A1B537B401; Mon, 21 Oct 2002 00:16:08 -0700 (PDT) Received: from falcon.mail.pas.earthlink.net (falcon.mail.pas.earthlink.net [207.217.120.74]) by mx1.FreeBSD.org (Postfix) with ESMTP id D5AB243E97; Mon, 21 Oct 2002 00:16:02 -0700 (PDT) (envelope-from tlambert2@mindspring.com) Received: from pool0060.cvx21-bradley.dialup.earthlink.net ([209.179.192.60] helo=mindspring.com) by falcon.mail.pas.earthlink.net with esmtp (Exim 3.33 #1) id 183Wn5-0002VV-00; Mon, 21 Oct 2002 00:15:56 -0700 Message-ID: <3DB3A962.9F26FCA0@mindspring.com> Date: Mon, 21 Oct 2002 00:14:42 -0700 From: Terry Lambert X-Mailer: Mozilla 4.79 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Ruslan Ermilov Cc: "Andrey A. Chernov" , "M. Warner Losh" , arch@FreeBSD.ORG Subject: Re: color, again, in grotty References: <20021017.101833.110719994.imp@bsdimp.com> <20021018095026.GA3386@sunbay.com> <20021018.094801.123456703.imp@bsdimp.com> <3DB06A8B.E40B3004@mindspring.com> <20021018201919.GA15100@nagual.pp.ru> <20021021065156.GB14584@sunbay.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Ruslan Ermilov wrote: > > > > : So we must either fix syscons(4) or to somehow tell grotty(1) to > > > > : emit old sequences to print bold and italic characters. > > > > > > Fixing Grotty to use the termcap ("TermCap" -- Terminal Capabilities) > > > database is the correct approach, in almost all cases. > > > > I agree. Grotty should get termcap color capabilities using TERM env. > > variable, if output isatty(). That is termcap purpose. > > It is almost never isatty(), because the most typical scenario is > to pass the output through a pipe to ${PAGER}, or to a compressor. Pagers can't tell the difference between an escape sequence that results in characters which are not displayable without the escape sequence (and therefore take a character cell on the screen) and those which manipulate display attributes (and therefore do not take any screen space) from those which do cursor positioning in place of "CR/LF" (e.g. "delete line" at the top of the page is equivalent to scrolling) vs. those which do nothing apparent. Therefore, it's unreasonable to run processed data through a pager, if the results of that processing include terminal implementation dependent escape sequences.. The way this is normally dealt with is to use "_^HX" for underscore, "X^HX" for bold, etc., utilizing "overstrike", and have the pager convert it based on the pager's knowledge of the terminal display sequences from the termcap. Note that, so long as ASCII (0x08) is backspace, and moves the cursor one to the left, in the absence of additional terminal interpretation, the resulting data will be displayed as readable text, minus the attributes (e.g. even if the second character replaces, rather than overstriking the first, the text will end up being the same, without any display attributes at all). I guess a lot of kids these days have grown up without having to use real tty or terminal hardware, so they don't understand all the work that has already gone into finding the correct way to deal with these issues... -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message