[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-readline] rl_initialize will always write to stdout even if no
From: |
Chet Ramey |
Subject: |
Re: [Bug-readline] rl_initialize will always write to stdout even if no readline services yet requested |
Date: |
Tue, 25 Jun 2013 10:49:17 -0400 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130509 Thunderbird/17.0.6 |
On 6/14/13 7:18 PM, Dan Mick wrote:
> Several programs that use libreadline (a python script that imports
> readline for purposes of making Python's raw_input() use readline support,
> parted) were, in some cases, outputting escape codes to stdout, even if no
> user input was requested or processed. These codes
> corrupted the expected output of the programs and consumers of it.
>
> This stems from the 'meta-key' support: if the terminal reports it has a
> meta key and gives a meta-key enable string, rl_initialize() always outputs
> it, whether or not stdin is even a terminal. (_rl_enable_meta_key())
I changed this for bash-4.3/readline-6.3. The meta key is only active for
the duration of a single call to readline().
Readline assumes in many places that the caller checks whether or not it's
being called with a terminal or equivalent as stdin/stdout, but I can look
at adding a check for a terminal here.
Chet
--
``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/