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:

  1. Create a Tokio Reactor that will handle all of your asynchronous I/O.
  2. Create an AsyncPtyMaster that represents your ownership of an OS pseudo-terminal.
  3. Use your master and the spawn_pty_async or spawn_pty_async_raw functions of the CommandExt extension trait, which extends std::process::Command, to launch a child process that is connected to your master.
  4. 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 std::process::Command type.