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 15231.1450294166@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: fix for readline terminal size problems when window is resized with open pager  (Merlin Moncure <mmoncure@gmail.com>)
Ответы Re: fix for readline terminal size problems when window is resized with open pager  (Merlin Moncure <mmoncure@gmail.com>)
Re: fix for readline terminal size problems when window is resized with open pager  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Список pgsql-hackers
I did some more experimentation and concluded that actually, this problem
has nothing whatsoever to do with pager invocations.  What seems to really
be happening is that libreadline activates its SIGWINCH handler only while
it's being called to collect input, which is fine in itself, but *it does
not notice screen resizes that happen when the handler is not active*.

You can prove this by doing, say, "select pg_sleep(10);" and resizing
the window before the backend comes back.  Readline never notices the
resize, even though no pager invocation happens at all.

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.

And somebody oughta report this as a libreadline bug ...
        regards, tom lane



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

Предыдущее
От: Fabien COELHO
Дата:
Сообщение: Re: checkpointer continuous flushing
Следующее
От: Merlin Moncure
Дата:
Сообщение: Re: fix for readline terminal size problems when window is resized with open pager