groff
[Top][All Lists]
Advanced

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

Re: The 3-faces problem


From: Alejandro Colomar (man-pages)
Subject: Re: The 3-faces problem
Date: Tue, 2 Nov 2021 23:58:27 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.1

Hi, Branded!

On 11/2/21 19:45, G. Branden Robinson wrote:
Hi, Alex!

At 2021-11-02T19:07:05+0100, Alejandro Colomar (man-pages) wrote:
On 11/2/21 18:49, G. Branden Robinson wrote:
printf '_\\fB_\\fI_\\f(BI_\n' | nroff | cat -s

Yes, I see 4 different glyphs.

Okay, so that much is sane in our respective environments.  :)

I was using xface termincal, but I tried on xterm after your email and
see the same result.  IF you have a big enough font size and print
them almost together, you'll be able to see the difference:

$ cat underscore.7test
.TH UNDERSCORE 7TEST today
.SH UNDERSCORE
.RB [ U ] INT \fIN\fP _WI_DTH RO_MAN

There are 3 different underscores: italics, bold, and roman,
respectiely.  At least with the less pager.  more doesn't even
highlight, so I can't test with a different pager.

I used `man ./underscore.7`.

I get _visually_ identical output[1] dumping straight to the terminal
with "nroff -man", piping through "less -R", piping through "more", and
running "man" on the file.

For me, there are two different outputs:

A:
        $ nroff -man ./underscore.7
        $ nroff -man ./underscore.7 | more
        $ man -P more ./underscore.7

B:
        $ nroff -man ./underscore.7 | less
        $ nroff -man ./underscore.7 | less -R
        $ man ./underscore.7

In case A, I see plain text, as if the pager was cat (no highlighting at all).

In case B, I see 3 different underscores, as I previously said. It seems to me that the bug that was reported to Debian may responsible for that, since it only happens if there's a leading underscore in the word.

I'll send you a following email with a PNG of what I see.


However, when I further pipe each of these through xxd, I get the same
results for the first three--but "man" produces different output.

With xxd I have the same results as you.  man is different.

 I
suppose this has something to do with the GROFF_SGR (N.B., not
"GROFF_NO_SGR" [see grotty(1)]) feature that man-db man added in
response to complaints from people who were nostalgic for the wire
protocol of Western Electric Teletypes and simultaneously harassing
Thomas Dickey for 24-bit direct color support in ncurses so they could
"skin" Midnight Commander.[2][3]

Anyway, I think what is happening with man is that it is forcing grotty
into overstriking mode, calling less as the pager, and less is
reconstructing SGR escape sequences based on its heuristic
interpretation of the overstriking sequences.  Mark Wooding did warn
us[2] that this was theoretically possible.

I can't get less(1) to reveal to me what SGR escape sequences it's
constructing; when I try, apparently it calls isatty() on its output
conceals them if it returns false.  But it's absolutely munging its
input because the overstriking sequences are not present.

Can you confirm that you're getting the same output I shared earlier
from running "nroff -man" directly on the file, with no pager?  It's
important for the troubleshooting process that we determine if our
grotty(1)s are behaving the same.  From there we can try to determine if
a pager or man(1) is somehow corrupting things.

See above.  If you need me to try any other commands, tell me.


Oh, also, I'm running a pretty new less(1).  I compiled less 581.2 from
source so I could test the new OSC 8 stuff in grotty(1)[4].  It could
easily be behaving differently from your less(1); sid seems to have
551?[5]

Yes, 551.


Regards,
Branden

[1] But like the rest of me, my eyes aren't as young as they used to be.
[2] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=963490
[3] https://invisible-island.net/ncurses/ncurses-slang.html
[4] https://lists.gnu.org/archive/html/groff/2021-10/msg00000.html
[5] http://ftp.au.debian.org/debian/pool/main/l/less/


Regards,

Alex

--
Alejandro Colomar
Linux man-pages comaintainer; https://www.kernel.org/doc/man-pages/
http://www.alejandro-colomar.es/



reply via email to

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