export LESS=-R
to get color in less
outputIt is super annoying that you only get a single pager
executable and can’t even reliably know which one it is just by examination. So, it turns out, less
has add the LESS
environment variable in which you can put all the switch you want but cannot pass to the pager itself.
This fix is a life-saver when it comes to tools and scripts that need to detect the system pager and use it, but that you cannot be sure of being there. I actually hard-coded a check for less
and added a -R
only to learn soon after that LESS
exists and allows the user to have all the control about what they want less
to do.