bug-texinfo
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: new grotty format


From: Werner LEMBERG
Subject: Re: new grotty format
Date: Sat, 09 Feb 2002 19:35:01 +0100 (CET)

[About the new grotty output format using SGR escape sequences.]

> This change in Groff raises an interesting issue: what should Info
> do with these escape sequences.  Is it okay to check whether the
> terminal supports colors, and if so, let the escape sequences get
> through unaltered, and otherwise strip them away (with the exception
> of bold and underline escapes)?

I'm wondering what Info does with the old sequences containing `\b'.
Some terminals like xterm can't digest them -- I couldn't find code
in info where these are handled.

Note that I'm very poor in understanding terminals, and I've tested
the new grotty output only with the Linux console and xterm, both
which understand SGR.  So I have no idea how info interacts with
terminals.

The man page I've sent to you is an extreme example, created by a
special screen dumping program; by default, no colors are used if you
restrict yourself to the standard man macros.

> Also, I'm unsure what would a typical `man' and a typical pager do with
> those escapes, especially if the terminal doesn't support colors?
> What does, for example, GNU Less do?

You need the option -R.  Either set the PAGER environment variable
like this:

  PAGER="less -R"

or use the -P option of man to specify the pager executable and its
options, or modify the configuration file of `man'.  Until now,
displaying a man page without a pager produces a lot of garbage on
most terminals.  The new output can usually displayed on terminals
directly (including the MSDOS console I think), but the pager programs
have to be adjusted.  Currently, `less' still exhibits some nasty bugs
displaying SGR stuff (I've reported them already to Mark Nudelman).

> Finally, what about terminals whose color commands are not the SGR
> escape sequences?

If the terminal understands SGR, unknown sequences are ignored AFAIK.

> Or do all Unix terminals support SGR?  (I'm asking because I clearly
> see in the termcap/terminfo data base many terminals whose color
> commands are different from what the example you sent shows.)

I don't know.  SGR is SGR is SGR :-) You can get the ISO 6429 standard
from ECMA; look for Ecma-048.pdf at www.ecma.ch.

Anyway, you can disable SGR.  grotty has the option `-c' to use the
old drawing scheme (with `\b').  With groff, you must thus add `-P-c'
to pass `-c' to the postprocessor.  Similarly, the nroff script has
also a `-c' option to use the old drawing scheme.

> > At least the `-p' option to select/unselect preprocessors should be
> > handled.
> 
> ??? I don't understand--AFAIK, most `man' versions don't have a -p
> option, as the formatter they invoke should DTRT automatically.
> Isn't that so?

Not always.  There is a convention that the first line of a man page
can contain the special line

  '\" <string>

where <string> is a combination of letters specifying the
preprocessor; e.g.

  '\" tr

to specify `tbl' and `refer' as preprocessors.  Unfortunately, `refer'
can cause problems: If a man page contains macro calls of the form

  .[f

`refer' thinks that a reference is started (`.['), handling `f' as a
special prefix -- this is really braindamaged syntax and fails with
classical troff also.  My man program calls `refer' by default
(perhaps a misconfiguration on my side which I haven't investigated
yet), so I have to say

  man -p "" foo

to disable `refer'.

I use man 2.3.19 from man-db.


    Werner



reply via email to

[Prev in Thread] Current Thread [Next in Thread]