Open
Description
In reference to IPython issue 10406, a useful prompt_toolkit
enhancement would be to more gracefully deal with text sent to sys.stdout
/ sys.stderr
from a background thread.
Per @jonathanslenders, this would entail using os.openpty()
to create a new pty, then use os.dup2
and fiddle with the file descriptors to make sure that prompt_toolkit
writes to the original stdout, while all stdout objects will point to a proxy object while the interface is visible. This would need a reader for the PTY master FD in the event loop.