[Top][All Lists]

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

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

From: Ulf Magnusson
Subject: Re: [Bug-readline] Forwarding input from ncurses to readline
Date: Fri, 20 Feb 2015 15:20:47 +0100

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.

Might look into it some more later.


reply via email to

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