I'm trying to get my psql pager output to look nicer.

I've added the following to my ~/.bashrc

export PAGER='less -S'

And I've added these line to my ~/.psqlrc

\x auto
\pset pager on
\setenv PAGER less

Current output:

Current pager output

Desired output:

Desired pager output


\setenv PAGER less in .psqlrc overwrites the environment variable with an undesirable different value (without the -S option).

Either remove it, or change it to \setenv PAGER 'less -S', or create a new environment variable LESS set to -S

Note that even when less is not called with the -S / --chop-long-lines option, hitting the right arrow key will scroll horizontally and temporarily display lines without wrapping them.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.