NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: bin/58579: man(1) should make use of terminal width
The following reply was made to PR bin/58579; it has been noted by GNATS.
From: Valery Ushakov <uwe%stderr.spb.ru@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc:
Subject: Re: bin/58579: man(1) should make use of terminal width
Date: Mon, 12 Aug 2024 12:17:42 +0300
This patch assumes man uses /usr/bin/mandoc to format the man pages
(what about /usr/pkg/bin/mandoc when using bsd userland commands on a
linux system, say?) and hardcodes knowledge of its -Owidth option. I
don't think this is the right direction.
As I noted in a related mail thread a few years ago, one can *almost*
make MANWIDTH do the riht thing without any changes to the man command
with something like:
_build .[1-9ln] /usr/bin/mandoc ${COLUMNS+-Owidth=${MANWIDTH:-$COLUMNS}} %s
which, unfortunately, 1) relies on COLUMNS bashism to get the terminal
size and 2) needs to add test -t 0 logic which quickly becomes
unwieldy for a single line command.
Like phone I find full-width manpage in a large terminals unusable, so
the feature I miss w.r.t. MANWIDTH is constraints, an ability to
express: please, use full terminal width if it's below 108 columns,
but don't use more - I don't find 200 characters lines comfortable to
read, also, don't try to use less than, say 72, most man pages with
offset lists/displays won't fit into that anyway.
Any proposed solution must also support (being applicable to) nroff.
On obscenely fast machines the pro-mandoc speed argument is rather
weak and a user should be able to use the old
/usr/bin/nroff -msafer -man
for its _build command
For the record, the way to tell nroff the page width with either old
man or mandoc is by setting number registers LL (length of line, like
.ll directive) and LT (length of title, like .lt) in 'n' units, e.g.
to format a man page to the width of 120 characters:
nroff -rLL=120n -rLT='\n(LL' -Tman
-uwe
Home |
Main Index |
Thread Index |
Old Index