My .psqlrc
has following options
\setenv LESS '-iMSx4 -FXR'
\setenv PAGER 'less'
\pset pager always
and psql output which I want to be colored is
{ +
\x1B[35m"\x1B[0m\x1B[35mr\x1B[0m\x1B[35m"\x1B[0m: [ +
\x1B[1m\x1B[92m"\x1B[0m\x1B[32m1\x1B[0m\x1B[1m\x1B[92m"\x1B[0m,+
\x1B[1m\x1B[92m"\x1B[0m\x1B[32m2\x1B[0m\x1B[1m\x1B[92m"\x1B[0m,+
\x1B[1m\x1B[92m"\x1B[0m\x1B[32m3\x1B[0m\x1B[1m\x1B[92m"\x1B[0m,+
\x1B[1m\x1B[92m"\x1B[0m\x1B[32m4\x1B[0m\x1B[1m\x1B[92m"\x1B[0m,+
\x1B[1m\x1B[92m"\x1B[0m\x1B[32m5\x1B[0m\x1B[1m\x1B[92m"\x1B[0m,+
\x1B[1m\x1B[92m"\x1B[0m\x1B[32m6\x1B[0m\x1B[1m\x1B[92m"\x1B[0m,+
\x1B[1m\x1B[92m"\x1B[0m\x1B[32m7\x1B[0m\x1B[1m\x1B[92m"\x1B[0m,+
\x1B[1m\x1B[92m"\x1B[0m\x1B[32m8\x1B[0m\x1B[1m\x1B[92m"\x1B[0m +
] +
}
Is there a way to make pager aware of \x1B
ansi sequences, or to tell psql
not to convert them to hexadecimal representations when displaying?
Output should look like,