Expand description
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
AsyncPtyMaster
that represents your ownership of an OS pseudo-terminal. - Use your master and the
spawn_pty_async
orspawn_pty_async_raw
functions of theCommandExt
extension trait, which extendsstd::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
Child
value returned by that function.
This crate only works on Unix since pseudo-terminals are a Unix-specific concept.
The Child
type is largely copied from Alex Crichton’s
tokio-process crate.
Structs§
- Async
PtyFd - A Future for getting the Pty file descriptor.
- Async
PtyMaster - A handle to a pseudo-TTY master that can be interacted with asynchronously.
- Async
PtyMaster Read Half - Read half of a AsyncPtyMaster, created with AsyncPtyMaster::split.
- Async
PtyMaster Write Half - Write half of a AsyncPtyMaster, created with AsyncPtyMaster::split.
- Child
- A child process that can be interacted with through a pseudo-TTY.
Traits§
- AsAsync
PtyFd - Trait to asynchronously get the
RawFd
of the master side of the PTY - Command
Ext - An extension trait for the
std::process::Command
type. - PtyMaster
- Trait containing generalized methods for PTYs