conpty 0.1.0

A library which provides an interface for ConPTY
docs.rs failed to build conpty-0.1.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: conpty-0.5.1

conpty

A library which provides an interface for ConPTY.

It is originally developed to be a windows backend for zhiburt/expectrl.

Get started

use std::io::prelude::*;

fn main() {
    let proc = conpty::spawn("echo Hello World").unwrap();
    let mut reader = proc.output().unwrap();

    println!("Process has pid={}", proc.pid());

    proc.wait(None).unwrap();

    let mut buf = [0; 1028];
    let n = reader.read(&mut buf).unwrap();
    assert!(String::from_utf8_lossy(&buf[..n]).contains("Hello World"));
}