Re: fix for readline terminal size problems when window is resized with open pager - Mailing list pgsql-hackers

From Andres Freund
Subject Re: fix for readline terminal size problems when window is resized with open pager
Date
Msg-id 20151216173214.GH23112@awork2.anarazel.de
Whole thread Raw
In response to Re: fix for readline terminal size problems when window is resized with open pager  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: fix for readline terminal size problems when window is resized with open pager  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On 2015-12-16 12:23:28 -0500, Tom Lane wrote:
> It may be that we can't fix this in readline versions that precede the
> introduction of the resize function.  Let me go experiment on my pet
> dinosaurs.

I'm not particularly bothered by not supporting old readline versions
here. If we really want to we could basically directly use
_rl_get_screen_size() - which seems to have been present from before
4.0. It's not declared static...

extern void _rl_get_screen_size (int tty, int ignore_env);
and then   _rl_get_screen_size (fileno (rl_instream), 0);
in ClosePager() seems to do the trick.

Andres



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: fix for readline terminal size problems when window is resized with open pager
Next
From: Robert Haas
Date:
Subject: Re: Re: Reusing abbreviated keys during second pass of ordered [set] aggregates