Re: psql/readline clears screen

From: Reece Hart <reece(at)harts(dot)net>
To: Merlin Moncure <mmoncure(at)gmail(dot)com>
Cc: PgSQL-General <pgsql-general(at)postgresql(dot)org>
Subject: Re: psql/readline clears screen
Date: 2006-08-09 16:51:38
Message-ID: 1155142298.3808.154.camel@tallac.gene.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, 2006-08-09 at 09:02 -0400, Merlin Moncure wrote:

> is there a way to configure psql/readline so that it doesn't clear the
> screen after browsing a query with 'q'?

I assume you're using the less text pager on a Unix box. I think what
you're seeing is less clearing the screen after displaying a query
(i.e., it's not psql or readline).

I like the following invocation: less -iMSx4 -FX (see less manpage for
explanation). This is particularly useful with ' \pset pager
always' (in .psqlrc). The upshot is that less will decide whether the
contents fit on one screen both horizontally and vertically; if so it'll
display and quit without any interaction, and if not it will permit
scrolling in one or both directions.

There are two ways you might enable this:
- set and export the LESS environment variable in your shell setup, like
this in .bashrc:
export LESS='-iMSx4 -FX'
- prefix your psql invocation with the LESS environment variable
setting, like this:
$ LESS='iMSx4 -FX' psql <optargs...>

-Reece

--
Reece Hart, http://harts.net/reece/, GPG:0x25EC91A0

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message DEV 2006-08-09 16:59:15 WIN32 Build?
Previous Message Harpreet Dhaliwal 2006-08-09 15:02:00 Connection string