echo problem in Xcode debugger console when using libreadline/libedit

Originator:ewmailing
Number:rdar://10660201 Date Originated:2012-01-07
Status:Open Resolved:
Product:Developer Tools Product Version:4.2 4D199
Classification:Other Bug Reproducible:Always
 
Summary:
It seems that Xcode's debugger console/terminal has an echo bug with programs that use libreadline/libedit. When enabled, every character I type gets immediately echoed by the console so it looks like I typed it twice (even though I didn't). If I paste a phrase in the console, the whole phrase gets echoed.

Steps to Reproduce:
Attached is an Xcode project I made for Lua which has a command line tool. I just enabled it to compile with readline support.
Build and run the 'lua' target (the command line tool, not the library).
When the program is running through the debugger In the Xcode, in the debugger console, try two things:
First type:
print("Hello World");
(you may hit enter after to submit it)
You will see each character echoed as you type it. Notice the command succeeds meaning the echo characters at least didn't get into the input stream.

Second copy and paste into the console:
print("Hello World");
You will see it echoed like:
print("Hello World");print("Hello World");

I do notice that if you omit the semicolon in the copy/paste case (but not the type in manually) and hit enter, it causes some kind of error in the interpreter. That shouldn't happen because semi-colons are optional in Lua, so I think the input stream is not quite right in this case.


Expected Results:
No echoed characters.

Actual Results:
Echoed characters.

Regression:
Don't know, but probably an Xcode 4 introduction.

Notes:

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!