Re: psql screen size - Mailing list pgsql-general

From Gregory Stark
Subject Re: psql screen size
Date
Msg-id 87skqf8y78.fsf@oxford.xeocode.com
Whole thread Raw
In response to Re: psql screen size  (wstrzalka <wstrzalka@gmail.com>)
Responses Re: psql screen size  (Gregory Stark <stark@enterprisedb.com>)
List pgsql-general
wstrzalka <wstrzalka@gmail.com> writes:

> On 27 Paź, 13:16, s...@samason.me.uk (Sam Mason) wrote:
>> On Mon, Oct 27, 2008 at 01:59:42AM -0700, wstrzalka wrote:
>>
>> > When changing the window size (and those chars per row) psql output
>> > becomes mess, the only rescue is to exit and run the psql again. It
>> > looks like it's initializing the output params at startup and don't
>> > refresh it in runtime.

At least in CVS HEAD it checks before every query output.

However...

>> Resizing the window when entering SQL works OK for me, but resizing when
>> inside my pager (normally the "less" utility, when you get more results
>> than will fit on the screen) causes psql to be confused when I return to
>> it.
>
> Yes. This is exactly the case. When I browse large paged query result
> and resize during that, the screen is messed up.

Could you define "messed up"?

What I see is that the query output is formatted correctly but readline still
thinks the screen is the old size. (This is in CVS HEAD -- this code was
definitely different in 8.3 and before so the behaviour may be different).

Perhaps we need to tell readline whenever we run a subprocess and it may have
missed screen resize signals.

It's easy enough to work around, just resize the window again a little bit
once you're at the prompt. Readline notices that and adjusts.


--
  Gregory Stark
  EnterpriseDB          http://www.enterprisedb.com
  Ask me about EnterpriseDB's On-Demand Production Tuning

pgsql-general by date:

Previous
From: "Isak Hansen"
Date:
Subject: Re: postgresql and Mac OS X
Next
From: Abdul Rahman
Date:
Subject: Re: Replication with slony-I