Saturday, February 23, 2013

Get Man to Stop Clearing the Screen On exit

Someone put their head in a funnel for this one.

If you've recently did any man page reading on Ubuntu/Linux (10.04 LTE), you've likely been frustrated by the screen being cleared -- especially after spending a large amount of time reading the man page.

NOTE: If you just want to change just the behaviour of man(1), use MANPAGER instead of PAGER.

Add to your .bashrc (or .profile):

    export PAGER="/usr/bin/less -X"

According to man 1 less

       -X or --no-init
              Disables  sending  the  termcap  initialization and deinitialization strings to the
              terminal.  This is sometimes desirable if the deinitialization  string  does  some‐
              thing unnecessary, like clearing the screen. 
Your Welcome

No comments: