www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2001/02/19/08:36:53

X-Authentication-Warning: acp3bf.physik.rwth-aachen.de: broeker owned process doing -bs
Date: Mon, 19 Feb 2001 14:36:08 +0100 (MET)
From: Hans-Bernhard Broeker <broeker AT physik DOT rwth-aachen DOT de>
X-Sender: broeker AT acp3bf
To: djgpp-workers AT delorie DOT com
Subject: Re: GNU_grep-2.5c_beta
In-Reply-To: <1659-Sun18Feb2001204848+0200-eliz@is.elta.co.il>
Message-ID: <Pine.LNX.4.10.10102191429130.7600-100000@acp3bf>
MIME-Version: 1.0
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Sun, 18 Feb 2001, Eli Zaretskii wrote:

> > Date: Sun, 18 Feb 2001 11:15:53 -0600
> > From: JT Williams <jeffw AT darwin DOT sfbr DOT org>
> > 
> > -: I'd argue that, once printed text is anything beyond simple ASCII text, a 
> > -: text-mode application such as Grep should use specialized functions to 
> > -: print the text with whatever markup it wants.
> > 
> > are you saying that individual programs
> > (e.g., `grep') should know how to handle screen-specific stuff like colors?
> 
> They should know that screen-specific stuff requires screen-specific
> functions.  Magic escape sequences printed via fprintf are
> non-portable to any system whose terminal driver doesn't include ANSI
> support.

Exactly. That's why Unixists invented termcap, in the first place ---
ANSI standard escape sequences are a good idea, but obviously that
standard came too late to be fully effective, so lots of terminals the
serial terminals that were actually used (some may still be) had ever
so slightly different codes.

I.e. instead of individual programs having to know all the fine details,
they just have to know and accept the guidance provided by the 'termcap'
or 'terminfo' database and associated library (curses).

> > Isn't this sort of thing properly handled by termio/termcap/whatever?  

In principle: yes. But we don't have a working termcap library for DJGPP.
Well, actually waaay back in DJGPP 1.09 times, I made one as part of the
initial port of 'info', but that relied on ANSI.SYS, too. For
screen-oriented programs, there'd be PDCurses on DJGPP, but for
stream-based markup like we need it here, I think we really need termcap.

> It is.  But please note that even termcap requires that you call
> specialized functions, such as tgetent, tputs, etc.

Exactly. So 'grep' should do that anyway, instead of assuming the terminal
is ANSI-compatible and color-capable. I.e. it already may have to be
considered broken or at least badly implemented on Unix, too, not just for
the purpose of the DJGPP port.

-- 
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.

- Raw text -


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