Hi folks,
We had a little program that we edited to use readline() instead of another
input method, and left in our existing code to print out a prompt, and just
called readline(NULL) (per this statment from the the manpage: "If prompt is
NULL or the empty string, no prompt is issued.") We found that in this case if
we entered some text and then backspaced it, on the final backspace not only
was the input erased, but also the (pre-printed) prompt. That is, when the
initial input character was backspaced, readline was erasing all the way to the
beginning of the line, beyond the input character that was being backspaced.
Example:
printf("NEXT: ");
command = readline(NULL);
Prompt/input:
NEXT: abc<BS><BS>_
Expected display:
NEXT: a_
Actual display (okay, so far so good):
NEXT: a_
Prompt/input:
NEXT: abc<BS><BS><BS>_
Expected display:
NEXT: _
Actual display (unexpected):
<empty line>
We had installed the 'libreadline6' and 'libreadline6-dev' packages, on Ubuntu
14.04. The header file says it is version 6.3.
Everything works fine if we switch to (e.g.) command = readline("NEXT: "). But
switching back to the preprinted prompt and the NULL readline prompt returns
the unexpected behavior described above.
Anyway, just an FYI, in case this is a bug as it appears (to us?) to be.
Regards,
Bob_______________________________________________
Bug-readline mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-readline