--- man.1 (revision 320400) +++ man.1 (working copy) @@ -328,6 +328,8 @@ option. .It Ev MANWIDTH If set to a numeric value, used as the width manpages should be displayed. +If set to a negative numeric value, and output is to a terminal, +the width is the whole width of the screen minus the specified value. Otherwise, if set to a special value .Dq Li tty , and output is to a terminal, --- man.sh (revision 320400) +++ man.sh (working copy) @@ -637,6 +637,15 @@ use_width=$MANWIDTH fi ;; + -[0-9]*) + if { sizes=$($STTY size 0>&3 2>/dev/null); } 3>&1; then + set -- $sizes + if [ $2 -gt 80 ]; then + MANWIDTH="${MANWIDTH#-}" + use_width=$(($2-$MANWIDTH)) + fi + fi + ;; [Tt][Tt][Yy]) if { sizes=$($STTY size 0>&3 2>/dev/null); } 3>&1; then set -- $sizes