Monday, February 4, 2013

Binding keys in psql

The psql client has a nasty habit of being a bit over-aggressive about when it routes output through the pager. So I oten find myself typing \pset pager to turn it off or on. Or I did up to today, when I finally got tired of it and added these lines to my .inputrc file:
$if psql
"\e[24~": "\\pset pager\n"
$endif
This binds the command to my F12 key, so now I can turn the pager on or off with a single key stroke.

No comments:

Post a Comment