On Tue, Aug 26, 2025 at 07:05:49AM +0200, Alejandro Colomar wrote:
[CC += Colin]
[CC += man-db-devel, and quoting most of this for reference]
On Mon, Aug 25, 2025 at 06:04:20PM -0500, G. Branden Robinson wrote:
tl;dr: Learn and use the "-rU0" option when your terminal device doesn't
support OSC 8 hyperlinks.
groff_man(7):
-rU0 Disable generation of URI hyperlinks in output drivers
capable of them, making the arguments to MT and UR calls
visible as formatted text. grohtml(1), gropdf(1), and
grotty(1) enable hyperlinks by default (the last only if
not in its legacy output mode).
If you _never_ use a terminal device that supports hyperlinking...
groff_man(7):
/.../share/groff/site-tmac/man.local
Put siteālocal changes and customizations into this file.
Thus, Helge might add
.if n .nr U 0 \" Format URLs on terminal devices.
to his system's "man.local" file.
[...]
> I can confirm. Branden, is this a bug? I think the Linux console
> should print the URI as in the old days.
I can't reproduce that behavior with groff 1.23.0 but I can with Git.
And that's due to a deliberate change.
NEWS[1]:
* Hyperlink support is now enabled by default on PDF and terminal
devices for an (man) and doc (mdoc) documents. Instructions and
commented code for disabling it are in the "man.local" and
"mdoc.local" files.
For the moment, groff's hands are kind of tied. To get this feature to
Just Work(TM) with no user involvement requires three things to happen.
1. grotty(1) needs to become a terminfo application. Lennart Jablonka
[...]
2. Once we have a tricked-out, terminfo-aware grotty, we meet another
problem:
There is no terminfo capability advertising OSC 8 hyperlink support.
[...]
3. Even once we have a grotty(1) that knows whether the terminal device
can render hyperlinks or not, we have yet another problem:
[...]
Thus, the formatted content of a document can depend on
properties of the output device in a new way, one more, uh,
"exciting" than the ~1972 binary choice of "is this an nroff device
[~terminal/typewriter]?" or "is this a troff device [typesetter]?",
or the ~1980 parameter "what is the name of the output device?"
(such as [Kernighan troff] "post", "l202", or [groff] "ps", "pdf",
"utf8").
Hmmmm, that sounds not good at all. How about moving this to man(1)?
That is, man(1) knows whether it is being piped or not, and thus can
tell groff(1) to do OSC8 or not. And even for the case of the terminal,
it is in a better position to pass the information to groff(1); we'd
still need points 1 (modified for man(1)) and 2, but not 3, which is
very ugly.
Doesn't man(1) have most of the same problem? It needs to know whether
the terminal emulator supports OSC 8, and I'm not aware of a way that it
could discover that at the moment; it's not just a question of whether
it's piped. I don't think that "put it in man-db's configuration file"
or "require a command-line option" would be particularly friendly
solutions to that problem.
If points 1 and 2 were handled in groff, then I wouldn't be necessarily
opposed to having man(1) tell the formatter that rendered hyperlinks are
acceptable, but it's not an area I'm all that familiar with. I'd be
happy to review patches provided that they retain compatibility with
reasonably old groff versions (man-db currently supports groff >= 1.21).
I could of course have man(1) unconditionally pass -rU0 to groff until
the problem is resolved properly, which would at least preserve existing
behaviour for users of unreleased groff 1.24. I'm not sure whether that
would be considered as playing Core War with the manual page system ...
--
Colin Watson (he/him) [cjwat...@debian.org]