delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/09/21/20:50:30

Date: Tue, 21 Sep 1999 15:47:38 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Hans-Bernhard Broeker <broeker AT acp3bf DOT knirsch DOT de>
cc: djgpp AT delorie DOT com, "T.E.Dickey" <dickey AT clark DOT net>
Subject: Re: tgetstr, tputs & other term functions
In-Reply-To: <7s4q0s$gdl@acp3bf.knirsch.de>
Message-ID: <Pine.SUN.3.91.990921154708.19568f-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On 20 Sep 1999, Hans-Bernhard Broeker wrote:

> In the longer run, I doubt termcap (or terminfo, for essentially the
> same reason) can be implemented to use direct video memory writes and
> stuff, instead of an ANSI.SYS implementation. The main problem with
> that would be that application do have the choice to query termcap
> strings and print them on their own, without going through termcap at
> all. That means we'ld need an ANSI.SYS implementation inside the libc,
> checking and filtering all output to the console for those
> <ESC>-sequences, or require an external ANSI.SYS being preloaded for
> programs that use termcap.

I did something like that as part of the DJGPP port of GNU Fileutils
(to support "ls --color"), see the file src/ls-msdos.c in the ported
Fileutils source distribution, v2gnu/fil316s.zip.  It is quite easy,
using the DJGPP Filesystem Extension feature.  The beauty of it is
that the mainline source doesn't even know that somebody catches its
output and redirects it to direct screen writes.

I think something very similar can be used to make a port of Termcap
that doesn't require an external ANSI driver, and yet satisfies all
the requirements that Hans-Bernhard quite correctly wrote above.  The
code used by Fileutils already implements all the color-related ANSI
commands, so you only need to add the rest.

Adding the termcap query functions would be a rather trivial
excercise, unless I miss something.

Any takers?

- Raw text -


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