conpty 0.7.0

A library which provides an interface for ConPTY
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use std::io::{Read, Result};

fn main() -> Result<()> {
    let mut proc = conpty::spawn("echo Hello World")?;
    let mut reader = proc.output()?;

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

    let mut buf = [0; 1028];
    reader.read(&mut buf)?;

    assert!(String::from_utf8_lossy(&buf).contains("Hello World"));

    Ok(())
}