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 [email protected] http://cnswww.cns.cwru.edu/~chet/
_______________________________________________
Bug-readline mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-readline