[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: |
Tue, 17 Feb 2015 22:56:07 +0100 |
On Tue, Feb 17, 2015 at 10:48 PM, Chet Ramey <address@hidden> wrote:
> On 2/17/15 4:25 PM, Ulf Magnusson wrote:
>
>> Is the following comment in terminal.c outdated by the way?
>>
>> /* If we're being compiled as part of bash, set the environment
>> variables $LINES and $COLUMNS to new values. Otherwise, just
>> do a pair of putenv () or setenv () calls. */
>> if (rl_change_environment)
>> sh_set_lines_and_columns (_rl_screenheight, _rl_screenwidth);
>>
>> It doesn't seem to matter whether readline is compiled as part of bash.
>
> It does, actually. The trick is the traditional Unix linker behavior.
> There is a source file in the readline library that provides a set of
> functions whose names begin with sh_ (shell.o):
>
> sh_single_quote (string)
> sh_set_lines_and_columns (lines, cols)
> sh_get_env_value (varname)
> sh_get_home_dir ()
> sh_unset_nodelay_mode (fd)
>
> When readline is linked as part of bash, those are resolved from the
> bash binary, since those names are already known to the linker when it
> processes libreadline.a. All of the functions in that file are resolved
> from bash, so the file is not linked in. When readline is not being
> compiled as part of bash, those functions are not known when processing
> libreadline.a, and are resolved using the built-in readline versions, so
> the symbols in shell.o are used.
Ah, that clarifies it. :)
> If you don't want readline to modify $LINES and $COLUMNS, set
> rl_change_environment to 0.
>
> Chet
Yeah, I'll do that.
Thanks,
Ulf
- [Bug-readline] Forwarding input from ncurses to readline, Ulf Magnusson, 2015/02/17
- Re: [Bug-readline] Forwarding input from ncurses to readline, Chet Ramey, 2015/02/17
- Re: [Bug-readline] Forwarding input from ncurses to readline, Ulf Magnusson, 2015/02/17
- Re: [Bug-readline] Forwarding input from ncurses to readline, Chet Ramey, 2015/02/17
- Re: [Bug-readline] Forwarding input from ncurses to readline,
Ulf Magnusson <=
- Re: [Bug-readline] Forwarding input from ncurses to readline, Ulf Magnusson, 2015/02/18
- Re: [Bug-readline] Forwarding input from ncurses to readline, Chet Ramey, 2015/02/19
- Re: [Bug-readline] Forwarding input from ncurses to readline, Ulf Magnusson, 2015/02/20
- Re: [Bug-readline] Forwarding input from ncurses to readline, Chet Ramey, 2015/02/20
- Re: [Bug-readline] Forwarding input from ncurses to readline, Ulf Magnusson, 2015/02/20
- Re: [Bug-readline] Forwarding input from ncurses to readline, Ulf Magnusson, 2015/02/20
- Re: [Bug-readline] Forwarding input from ncurses to readline, Ulf Magnusson, 2015/02/20
- Re: [Bug-readline] Forwarding input from ncurses to readline, Chet Ramey, 2015/02/21
- Re: [Bug-readline] Forwarding input from ncurses to readline, Ulf Magnusson, 2015/02/21
- Re: [Bug-readline] Forwarding input from ncurses to readline, Chet Ramey, 2015/02/22