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: Fri, 20 Feb 2015 09:30:35 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.4.0

On 2/20/15 9:20 AM, Ulf Magnusson wrote:
> On Fri, Feb 20, 2015 at 3:27 AM, Chet Ramey <address@hidden> wrote:
>> On 2/18/15 9:43 PM, Ulf Magnusson wrote:
>>
>>> Re. rl_change_environment, there's this in the source:
>>>
>>> /* If this is non-zero, readline will set LINES and COLUMNS in the
>>>    environment when it handles SIGWINCH. */
>>> int rl_change_environment = 1;
>>>
>>> However, afaics readline does not update LINES and COLUMNS in the
>>> SIGWINCH handler, at least not in the non-bash case. Is there some
>>> motivation for this (besides being a bit tricky due to putenv/setenv not 
>>> being
>>> async-signal-safe)? The comment seems a little misleading either way. :)
>>
>> It does.  The SIGWINCH handler just sets a flag (_rl_caught_signal) and, as
>> a side effect, calls any application-specific SIGWINCH handler to allow it
>> to do the same.  When readline does its signal handling via the
>> RL_CHECK_SIGNALS macro, it notices that it caught SIGWINCH and calls
>> _rl_signal_handler with SIGWINCH as the argument.  _rl_signal_handler
>> calls rl_resize_terminal, which calls _rl_get_screen_size, which eventually
>> calls sh_set_lines_and_columns.
>>
> 
> Hmm... it's odd that ncurses doesn't pick up the updated LINES and COLUMNS
> variables then. It also forwards the signal in its SIGWINCH handler.

I thought you said you had forced readline to not catch signals; if
readline doesn't install signal handlers none of this is relevant.


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