expectrl
expectrl copied to clipboard
A rust library for controlling interactive programs in a pseudo-terminal
https://github.com/smol-rs/futures-lite/issues/47 It seems like read_line can write only in an empty buffer. So the behavior is differs from std::io::BufRead
Example, following example will cause 100% CPU usage. ```rust fn main() { let shell = "bash"; let mut sh = expectrl::spawn(shell.to_string()).expect("Error while spawning sh"); println!("Connecting to {}", shell); sh.interact().unwrap(); }...
in windows we can use syscall CreateProcessAsUserW to create cmd by another user. Is there any plan for this?
This will ignore the args in the `std::process::Command`: ```rs let mut cmd = std::process::Command::new("some_command"); cmd.env("some", "value").args(&["arg1"]); let p = expectrl::Session::spawn(cmd).unwrap(); ``` This seems to be because conpty 0.3 does not...
Just testing out this crate and it works great so far! What I've found though, is sometimes I want to see the output of what's happening and so I use...
Consider the following very simple use of `expectrl`: ```rust use expectrl::{spawn, Error}; use std::time::Duration; fn main() -> Result { println!("Spawning ..."); let mut p = spawn("cat")?; p.set_expect_timeout(Some(Duration::from_secs(3))); println!("Sending line ...");...

Hi, I'm trying to use expectrl to interact with a ssh password prompt on macOS (vers 12 if it matters) everything works but after the ssh session gets initialized the...