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

#40 in Windows APIs

Download history 782/week @ 2024-09-25 582/week @ 2024-10-02 597/week @ 2024-10-09 839/week @ 2024-10-16 685/week @ 2024-10-23 758/week @ 2024-10-30 1268/week @ 2024-11-06 1112/week @ 2024-11-13 956/week @ 2024-11-20 1058/week @ 2024-11-27 762/week @ 2024-12-04 761/week @ 2024-12-11 697/week @ 2024-12-18 332/week @ 2024-12-25 449/week @ 2025-01-01 869/week @ 2025-01-08

2,531 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

~121MB
~2M SLoC