(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

_______________________________________________
Bug-readline mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-readline

Reply via email to