This is an addendum to Jonathan de Boyne Pollard's Italics and colour in manual pages on a nosh user-space virtual terminal.
FreeBSD et al. has switched to mandoc as their main manpage formatter. This formatter is faster, but is only capable of emitting overstrike for bold and underline. The only way to see italicized text is by telling less
to make italics when it wants underline:
export LESS_TERMCAP_us=$(tput sitm || tput us) LESS_TERMCAP_ue=$(tput ritm || tput ue) 2>/dev/null
mandoc -mdoc <<< '.Em italics' | less
The export
command can be added to the last lines of the man_display_page
function, before the final eval
.
It's eludes me to see colors in man pages, since grotty
strongly discourages their direct use. I checked the groff
tmacs, but no color is requested in an
nor doc
.
Most sources recommend doing termcap force-feeding to show color, or using a most
pager that automatically does so. Konsole seems to do it automatically for underline, since it doesn't support underlining.
macOS's built-in grotty does not respect the -i
option at all, always emitting the overstrike sequence.