[Top][All Lists]

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

Re: [Bug-readline] redraw prompt line on resize

From: Chet Ramey
Subject: Re: [Bug-readline] redraw prompt line on resize
Date: Mon, 19 May 2014 10:45:02 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.5.0

On 5/19/14, 9:41 AM, Aleksandar Popadić wrote:
> Hi,
> with readline 6.3 the mechanism for handling window resize has changed.
> Previously the prompt line would redisplay on window resize. Now it doesn't
> redisplay until input. Was this intentional? It's causing me some problems.

Yes, readline-6.3 now does much less work in a signal handler context, in
favor of deferring that work until the current system call, whatever it is,
returns and readline is able to handle the signal in the standard execution
context.  The old behavior caused a number of problems, because it
resulted in readline, and the applications using it, calling unsafe
functions from its signal handlers.

One extreme example is the locks that glibc malloc uses; running malloc
from a signal handler that happened to be executed during a call to glibc
malloc could result in deadlock.

Since SIGWINCH doesn't interrupt a read(2) call, readline doesn't get to
handle the signal and resize the window, performing redisplay along the
way, until the read returns.

> Not long ago I implemented text reflow on window resize into a terminal
> emulator and I let readline do it's own reflow on the prompt line. This
> broke with readline 6.3. The prompt line would disappear until input. I can
> reflow the prompt line manually but it would get reflown again on input and
> it's impossible to get it working for all cases properly.

That's up to your implementation, I suppose.  Other terminal emulators --
I tested with Mac OS X  Terminal -- seem to redraw the window contents on
resize without disturbing the prompt too much.

``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]