On 3/21/15 10:59 AM, Carlos Pita wrote:
> Readline output line width is not correctly adjusted after window resizes.
> 
> In particular, this is a serious problem for people using tiling
> windows managers, as completion output is close to unreadable after
> window was shrunken.
> 
> This was already reported by someone else here:
>    http://lists.gnu.org/archive/html/bug-readline/2014-07/msg00004.html
> 
> To reproduce:
>   - open a terminal emulator window
>   - run, say, ipython
>   - type p and <tab> in order to autocomplete
>   - now reduce the window width
>   - type p and <tab> again and see how the ouput is ill formatted

As I recall from looking briefly at the ipython/python source code, it has
to do with python not handling the SIGWINCH and expecting readline to do
it even when readline is not active.  In readline-6.3, readline only
installs its signal handlers when rl_callback_read_char is called, which
python does only when it receives a character and its select(2) call
returns.  The way readline-6.2 and earlier did things, it could `steal'
signals from an application without being active.  I think python doesn't
handle SIGWINCH at all, which means that it expects readline's signal
handler to be active all the time, instead of just when python calls back
into readline to have it read a character.

A possible fix would be to have python's readline module install a signal
handler for SIGWINCH and have it set readline's idea of the screen size.

(I thought I wrote this up and sent it out a long time ago, but I guess I
didn't.  I apologize.)

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    [email protected]    http://cnswww.cns.cwru.edu/~chet/

_______________________________________________
Bug-readline mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-readline

Reply via email to