Skip to content

feature request: improve writing to stdout/stderr from background thread #494

Open
@zpincus

Description

@zpincus

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions