Re: fix for readline terminal size problems when window is resized with open pager

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andres Freund <andres(at)anarazel(dot)de>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: fix for readline terminal size problems when window is resized with open pager
Date: 2015-12-22 15:25:36
Message-ID: CAHyXU0xTu6QWRR3H3SX_y=MnaPZOHaqL_=ZyewwQ7MTYgUvd8A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Dec 16, 2015 at 2:12 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Merlin Moncure <mmoncure(at)gmail(dot)com> writes:
>> On Wed, Dec 16, 2015 at 1:29 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>>> So I now think that print.c shouldn't be involved at all, and the right
>>> thing to do is just have gets_interactive() invoke the resize function
>>> immediately before calling readline(). That will still leave a window
>>> for SIGWINCH to be missed, but it's a pretty tiny one.
>
>> right -- agreed.
>
> I tried that and found out that the first call dumps core because readline
> hasn't been initialized yet. To fix that, we need an explicit call to
> rl_initialize() instead of depending on readline() to do it for us.
> So I arrive at the attached modified patch.

This is working great. Is there anything left for me to do here?

merlin

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Magnus Hagander 2015-12-22 15:28:25 Re: Remove Windows crash dump support?
Previous Message Magnus Hagander 2015-12-22 15:13:34 Re: Maintenance on git.postgresql.org