9 releases (5 breaking)

0.7.0 Sep 23, 2024
0.5.1 Mar 31, 2023
0.4.0 Dec 24, 2022
0.3.0 Dec 21, 2021
0.1.1 Sep 7, 2021

#41 in Windows APIs

Download history 1309/week @ 2024-08-24 894/week @ 2024-08-31 776/week @ 2024-09-07 494/week @ 2024-09-14 987/week @ 2024-09-21 653/week @ 2024-09-28 482/week @ 2024-10-05 843/week @ 2024-10-12 785/week @ 2024-10-19 599/week @ 2024-10-26 1004/week @ 2024-11-02 1226/week @ 2024-11-09 888/week @ 2024-11-16 1279/week @ 2024-11-23 802/week @ 2024-11-30 716/week @ 2024-12-07

3,829 downloads per month
Used in 21 crates (4 directly)

MIT license

35KB
713 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

~127MB
~2M SLoC