Crate tokio_pty_process[−][src]
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
AsyncPtyMaster |
A handle to a pseudo-TTY master that can be interacted with asynchronously. |
Child |
A child process that can be interacted with through a pseudo-TTY. |
Traits
CommandExt |
An extension trait for the |