Less misbehaves when used for "man" pager...

Victor Gavin vic at grep.co.uk
Thu Apr 25 19:52:07 AEST 1991


In article <30370 at cs.yale.edu> fields-doug at CS.YALE.EDU (Doug Fields) writes:
>I have been running less (can't say which version but it's recent. 1.90
>perhaps?) sicne i've been running SCO Xenix and moved to SCO Unix. When
>I edit the /etc/default/man so that it uses less for the pager instead
>of pg, and you try to read a un-formatted man page (I installed the TPS
>from Xenix on my Unix), less will spew out a ton of warnings about things
>the terminal can't do, such as scroll backwards, etc. This has happened from
>both SCO products, 3.2.2 Unix and 2.3.3 Xenix. Is the TERM environment variable
>somehow misplaced or something?

If you look in the /etc/default/man file you'll see that there is a
variable called TERM which is set to (normally) lp. The man command
reads this and reset your true TERM to this value. This is why less
complains about not being able to understand your terminal. You can
verify this by running a subshell from less and echoing TERM.

The reason the SCO reset TERM from within /etc/default/man is to allow
for the command /usr/man/bin/nr which is invoked to format manual
pages which aren't in preformated form. TERM is then passed to the
nroff command (which isn't supplied with SCO !).

To fix this I just changed all occurrences of TERM in /etc/default/man
and /usr/man/bin/nr to MTERM and edited the binary /usr/bin/man and
replaced all occurrences of TERM=\0\0 with MTERM=\0. I was able to do
this because the strings are 0 padded to the nearest 4byte boundary,
so that to add a new letter, I had to remove one of the 0's. If there
hadn't been a spare \0 to remove, then renaming the variable would
have been sufficient (eg TERM -> MRET).

Remember to save your original man command.


		vic

PS Since we've got a network of machines here, I have a shell script
called nroff that calls nroff on another machine. Works great :-)
--
Victor Gavin <vic at grep.co.uk||..!ukc!grep!vic||..!ukc!vision!grep!vic>



More information about the Comp.unix.sysv386 mailing list