8 releases (4 breaking)

0.5.1 Mar 31, 2023
0.5.0 Mar 8, 2023
0.4.0 Dec 24, 2022
0.3.0 Dec 21, 2021
0.1.1 Sep 7, 2021

#51 in Windows APIs

Download history 649/week @ 2023-12-11 690/week @ 2023-12-18 548/week @ 2023-12-25 606/week @ 2024-01-01 408/week @ 2024-01-08 446/week @ 2024-01-15 513/week @ 2024-01-22 647/week @ 2024-01-29 677/week @ 2024-02-05 683/week @ 2024-02-12 495/week @ 2024-02-19 711/week @ 2024-02-26 573/week @ 2024-03-04 544/week @ 2024-03-11 597/week @ 2024-03-18 399/week @ 2024-03-25

2,266 downloads per month
Used in 19 crates (3 directly)

MIT license

32KB
694 lines

conpty Crate docs.rs license

A library which provides an interface for ConPTY.

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

Usage

Include the library to your Cargo.toml.

# Cargo.toml
conpty = "0.5"

Get started

Running echo and reading its output.

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(())
}

Dependencies

~153MB
~2.5M SLoC