bug-readline
[Top][All Lists]
Advanced

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

Re: [Bug-readline] Forwarding input from ncurses to readline


From: Chet Ramey
Subject: Re: [Bug-readline] Forwarding input from ncurses to readline
Date: Sat, 21 Feb 2015 11:56:13 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.2.0

On 2/20/15 8:01 PM, Ulf Magnusson wrote:

>> Pressing enter a few times and resizing the terminal in between shows
>> that LINES and COLUMNS never change. The select() is important here as
>> the program blocks inside rl_callback_read_char() otherwise, which
>> hides the issue.
>>
>> /Ulf
> 
> This comment makes it look like it's intentional:
> 
> "Signal handlers are only installed when the application calls back
> into readline, so readline doesn't `steal' signals from the
> application."
> 
> That seems to make letting readline deal with signals much less useful
> for the alternate interface though. Maybe the manual could clarify
> that you need to e.g. unprep the terminal yourself if a signal if a
> signal arrives between two rl_callback_read_char() calls.

It is intentional.  Consider the typical use case for the callback mode:
an application does whatever it does until it detects that input is
available, at which point it calls readline to read it.  If readline had
signal handlers installed the whole time, a SIGINT arriving while the
application had control would not be handled until the next keypress
that caused the application to call readline_callback_read_char().  That
could be a very long time.

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