Spawn a child process under a pseudo-TTY, interacting with it asynchronously using Tokio.
A pseudo-terminal (or “pseudo-TTY” or “PTY”) is a special Unix file handle that models the kind of text terminal through which users used to interact with computers. A PTY enables a specialized form of bidirectional interprocess communication that a variety of user-facing Unix programs take advantage of.
The basic way to use this crate is:
- Create a Tokio Reactor that will handle all of your asynchronous I/O.
- Create an
AsyncPtyMasterthat represents your ownership of an OS pseudo-terminal.
- Use your master and the
spawn_pty_async_rawfunctions of the
CommandExtextension trait, which extends
std::process::Command, to launch a child process that is connected to your master.
- Optionally control the child process (e.g. send it signals) through the
Childvalue returned by that function.
This crate only works on Unix since pseudo-terminals are a Unix-specific concept.
Child type is largely copied from Alex Crichton’s
A Future for getting the Pty file descriptor.
A handle to a pseudo-TTY master that can be interacted with asynchronously.
Read half of a AsyncPtyMaster, created with AsyncPtyMaster::split.
Write half of a AsyncPtyMaster, created with AsyncPtyMaster::split.
A child process that can be interacted with through a pseudo-TTY.
Trait to asynchronously get the
An extension trait for the
Trait containing generalized methods for PTYs
An async-fn version of PollPtyMaster