Skip to content

b23r0/conpty

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

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"));
}

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Rust 99.8%
  • Python 0.2%