bug-readline
[Top][All Lists]
Advanced

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

Re: [Bug-readline] Bug report: Unwanted output on stdout from rl_initial


From: Miroslav Lichvar
Subject: Re: [Bug-readline] Bug report: Unwanted output on stdout from rl_initialize()
Date: Fri, 22 Apr 2011 14:19:07 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

(resurrecting an old thread)

On Thu, Aug 02, 2007 at 11:45:26AM +1000, Glen Coates wrote:
> $ python test.py | od -tc
> 0000000 033   [   ?   1   0   3   4   h   H   e   l   l   o  \n
> 
> By recompiling python, I managed to trace the output to rl_initialize():
> 
> <test.c>
> 
> #include <stdio.h>
> #include <readline/readline.h>
> #include <readline/history.h>
> 
> int main()
> {
>       rl_initialize();
>       printf( "hello\n" );
>       return 0;
> }
> 
> $ ./test | od -tc
> 0000000 033   [   ?   1   0   3   4   h   h   e   l   l   o  \n
> 
> Could you please confirm whether or not this is a bug in readline,
> or rl_initialize() is being used incorrectly and thus a bug report
> should be made to the Python project?

This is caused by the _rl_enable_meta_key() which prints the mm/smm
sequence from termcap/terminfo. In recent readline versions it can be
disabled by the enable-meta-key variable.

Do you think the python readline module should avoid calling
rl_initialize() or would it be possible to delay printing of the string
in readline until readline() is called?

Also, if the smm string is printed, perhaps the rmm string should be
printed after readline() is done? I remember this was causing some
problems with xterm and the eightBitInput resource.

Thanks,

-- 
Miroslav Lichvar



reply via email to

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