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

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: fix for readline terminal size problems when window is resized with open pager
Дата
Msg-id 20004.1450282913@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: fix for readline terminal size problems when window is resized with open pager  (Andreas Karlsson <andreas@proxel.se>)
Ответы Re: fix for readline terminal size problems when window is resized with open pager  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers
Andreas Karlsson <andreas@proxel.se> writes:
> Did you manage to figure out why one was better than the other? The 
> differences between the functions seem rather subtle.

I'm a bit suspicious of Merlin's recommendation as well.  Looking at
the readline 6.3 sources, it is rl_resize_terminal() not the other
one that is called when an actual SIGWINCH is handled.

Another issue is that rl_reset_screen_size() doesn't exist in older copies
of readline (I don't see it in 4.0 nor 4.2a, which is what I've got laying
around in my archives).  So even if we agree that that's the one to use
when available, we'd need configure logic to fall back to
rl_resize_terminal() otherwise.

> rl_resize_terminal()
> Respects COLUMNS and ROWS and also has some logic when echo mode is 
> turned on which I have not managed to understand yet.

It looks to me like what it's doing is repainting the current line
on the theory that it might be messed up.  Since we are, at this
point, presumably *not* in the middle of accepting a command line,
that should be unnecessary but also harmless.  If there is any
visible difference in behavior, I should think it would be
rl_resize_terminal() that produces more consistent results, because
it does have the repaint logic which the other lacks.
        regards, tom lane



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tomas Vondra
Дата:
Сообщение: Re: Performance improvement for joins where outer side is unique
Следующее
От: Andres Freund
Дата:
Сообщение: Re: fix for readline terminal size problems when window is resized with open pager