FAQ

#!/bin/sh
export GROFF_NO_SGR=1
/usr/local/bin/xman

GROFF_NO_SGR needs to be set when starting xman on FreeBSD because during compiling, xman.c checks which OS it's being compiled on & hardwires nroff -mandoc as its page formatting aid if it detects the BSDs. However, nroff's mandoc macros output ANSI escape codes, while xman expects typewriter-style back up & overstrike codes.

Add the following to the your script starting xman:

if [ -z "$MANPATH" ]; then export MANPATH=`manpath`; fi

xman relies on the MANPATH variable being set, but fresh installs don't set it (relying on /usr/bin/manpath as well instead).