Skip to content

Create a Term from arbitrary Read and Write pair #34

@argv-minus-one

Description

@argv-minus-one

Currently, a Term can only be created from stdin and either stdout or stderr. This covers the most common case, but is rather inflexible.

The issue I'm running into is that I can't mock user interaction with my program (which uses dialoguer) in a test case, because there's no way to create a Term that's connected to mock I/O streams.

Another possible use case is interacting with a user through a socket. For instance, a Rust program might contain an embedded SSH server and interact with users that way.

Please consider allowing the creation of Terms connected to arbitrary Read and Write implementations, or at least arbitrary file descriptors/handles.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions