[Python-ideas] Suggestion: Clear screen command for the REPL

eryk sun eryksun at gmail.com
Mon Sep 19 11:39:15 EDT 2016


On Mon, Sep 19, 2016 at 3:07 PM, Oleg Broytman <phd at phdru.name> wrote:
>    [Ctrl+D] also recognized as EOF only at the start of an input.

You're right. I was mixing it up with sys.stdin.buffer.raw.read(), for
which Ctrl+D can end the read anywhere if entered twice. Having to
enter it twice may be a bug, because os.read(0, 100) works fine.

So making it compatible with GNU readline is more complicated, but I
think it's possible. If the Ctrl+D isn't at the start of the line, it
could write the result up to the "\x04" back to the input buffer and
resume the read.


More information about the Python-ideas mailing list