Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 21 Oct 2002 14:47:58 +0300
From:      Ruslan Ermilov <ru@FreeBSD.ORG>
To:        "Andrey A. Chernov" <ache@nagual.pp.ru>
Cc:        Terry Lambert <tlambert2@mindspring.com>, "M. Warner Losh" <imp@bsdimp.com>, arch@FreeBSD.ORG
Subject:   Re: color, again, in grotty
Message-ID:  <20021021114758.GB66084@sunbay.com>
In-Reply-To: <20021021105047.GA22255@nagual.pp.ru>
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> <3DB3A962.9F26FCA0@mindspring.com> <20021021074056.GE14584@sunbay.com> <20021021105047.GA22255@nagual.pp.ru>

next in thread | previous in thread | raw e-mail | index | archive | help

--TakKZr9L6Hm6aLOc
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Mon, Oct 21, 2002 at 02:50:47PM +0400, Andrey A. Chernov wrote:
> On Mon, Oct 21, 2002 at 10:40:56 +0300, Ruslan Ermilov wrote:
>=20
> > So far nobody told me what would be the correct alternative way to
> > support colors in grotty(1).  I tried the isatty() + libtermcap
> > approach first, but it died horribly because the output is almost
> > never a TTY.  It became apparent to me that grotty(1) cannot use
> > libtermcap, because it never knows what TERM it will be displayed
> > on -- quite often the grotty(1) output is saved for future reference
> > (e.g., in the form of catpages).  Such an alternative would be to
> > write a filter (similar to or extending the functionality of ul(1))
> > that would be capable of parsing the ANSI SGR attribute/color
> > sequences and translate them to the right sequences for a given
> > output device, or to strip them off completely.
>=20
> I already tell correct alternative in my other mail to this thread,=20
> without isatty, I mean
>=20
> Message-ID: <20021019135038.GA37956@nagual.pp.ru>
>=20
> From it you can see how grotty _can_ use libtermcap without isatty, if=20
> final device is known beforehead.
>=20
But it isn't.  For a manpage, man(1) compresses and stores the output
from grotty(1) in /usr/share/man/cat? cache, and later displays it on
this or that terminal (which are unknown beforehand and may differ).

Most of you (including me) seem to agree that there is no crime in
"backspace" sequences representing boldness and underlining, yet you
call them device-independent (DI) -- only because they're natural for
a matrix printer and because classical filters like ul(1) and more(1)
were capable of translating them to the right escapes.  But these
"backspace" sequences do not provide a way to manipulate a color, yet
they are not nearly DI if you pass them directly to some terminals
(outputting the character at the 80th position followed by a backspace
won't necessarily return a cursor to a previous line).  AT&T nroff(1)
wasn't producing the device independent output, as the colcrt(1) and
col(1) manpages may hint you.  So please stop calling "nroff" output
device-independent.

OTOH, ANSI SGR sequences allow one to manipulate both attributes and
colors.  One day soon, less(1) will be "fixed" to map the ANSI SGR
escapes back to the terminal's native, like it currently does for
backspace sequences.  It actually already semi-supports them through
the -R option (in that sense that they are accounted for properly).

Would you tell me the same if both less(1) and ul(1) were capable of
handling ANSI SGR sequences by default using the terminal's hardware
capabilities?

I'm sorry, but I really fail to see why do you think that backspace
sequences are safer/better than ANSI SGR?

Please think about it before replying.


			Ancient backspace	Modern ANSI SGR
			escapes			escapes
----------------------- ----------------------- ---------------
raw TTY printing	no			no
require filtering	yes			yes
attribute support	yes			yes
color support		no			yes
require s/w mods	no			yes


Cheers,
--=20
Ruslan Ermilov		Sysadmin and DBA,
ru@sunbay.com		Sunbay Software AG,
ru@FreeBSD.org		FreeBSD committer,
+380.652.512.251	Simferopol, Ukraine

http://www.FreeBSD.org	The Power To Serve
http://www.oracle.com	Enabling The Information Age

--TakKZr9L6Hm6aLOc
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (FreeBSD)

iD8DBQE9s+luUkv4P6juNwoRAmkyAJ9GiDmc3abIgG57cHPa38nKILGJAQCdEvLJ
zkXWpsIphUKXUixBrqw4vvA=
=jzDG
-----END PGP SIGNATURE-----

--TakKZr9L6Hm6aLOc--

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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021021114758.GB66084>