5 unstable releases
Uses new Rust 2021
0.3.0 | Dec 21, 2021 |
---|---|
0.2.1 | Sep 12, 2021 |
0.2.0 | Sep 12, 2021 |
0.1.1 | Sep 7, 2021 |
0.1.0 | Sep 6, 2021 |
#73 in Windows APIs
201 downloads per month
Used in 2 crates
(via expectrl)
31KB
616 lines
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"));
}
lib.rs
:
A library which provides an interface for ConPTY.
# // todo: determine why this test timeouts if runnin as a doc test but not as an example.
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"));
}
Dependencies
~214MB
~3.5M SLoC