recentpopularlog in

Copy this bookmark:





to read

bookmark detail

bash - 'man' page is too narrow (not taking advantage of terminal size) - Unix & Linux Stack Exchange
Today I learned (more 'strace' tricks):
<code class="language-bash">grep groff log | sed 's/\], \[.*//'
# result:
# 28721 execve("/usr/bin/groff", ["groff", "-mtty-char", "-Tutf8", "-mandoc", "-rLL=171n", "-rLT=171n"</code>
So, something like this will give you the line length you want (since most of the time 'man` is doing some magic to autodetect your terminal width):
<code class="language-bash">
wget -qO - https://opensource.apple.com/source/file_cmds/file_cmds-212/stat/stat.1 \
| groff -man -Tutf8 -rLL=${COLUMNS}n \
| less
</code>
Only '-rLL=XXn' is required; the title length is inferred from that, if not otherwise specified.
unix  linux  manpage  groff  terminalwidth  solution 
november 2019 by kme
view in context