bug-readline
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-readline] Line width not adjusted after window resizes


From: Chet Ramey
Subject: Re: [Bug-readline] Line width not adjusted after window resizes
Date: Sat, 21 Mar 2015 19:26:22 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.5.0

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    address@hidden    http://cnswww.cns.cwru.edu/~chet/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]