And the failure for 4 is reproducible if you use the backspace key on the input; since we're not using a real readline library that counts characters, a backspace will delete the character on the screen but leave part of the bytes in the input buffer.
And the failure for 4 is reproducible if you use the backspace key on the input; since we're not using a real readline library that counts characters, a backspace will delete the character on the screen but leave part of the bytes in the input buffer.