On Tue, Feb 17, 2015 at 10:48 PM, Chet Ramey <[email protected]> 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 mailing list [email protected] https://lists.gnu.org/mailman/listinfo/bug-readline
