diff options
author | Jesse Luehrs <doy@tozt.net> | 2019-10-28 13:28:06 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2019-10-28 13:28:06 -0400 |
commit | 1a2bc078ef06b3a28d5c8ca5f2f495d63c3afbd8 (patch) | |
tree | edaaa8ac2f545f3694b386f2baefc8312f0dfb52 /src/repl.rs | |
parent | 607e9a1f1cbaa3f08d2d4c109821c6e987fa5a7e (diff) | |
download | nbsh-old-1a2bc078ef06b3a28d5c8ca5f2f495d63c3afbd8.tar.gz nbsh-old-1a2bc078ef06b3a28d5c8ca5f2f495d63c3afbd8.zip |
move to tokio-pty-process-stream
Diffstat (limited to 'src/repl.rs')
-rw-r--r-- | src/repl.rs | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/repl.rs b/src/repl.rs index 4188fbe..3ec7084 100644 --- a/src/repl.rs +++ b/src/repl.rs @@ -56,21 +56,24 @@ fn read() -> impl futures::future::Future<Item = String, Error = Error> { fn eval( line: &str, -) -> impl futures::stream::Stream<Item = crate::eval::CommandEvent, Error = Error> -{ +) -> impl futures::stream::Stream< + Item = tokio_pty_process_stream::Event, + Error = Error, +> { crate::eval::eval(line).context(Eval) } -fn print(event: &crate::eval::CommandEvent) -> Result<()> { +fn print(event: &tokio_pty_process_stream::Event) -> Result<()> { match event { - crate::eval::CommandEvent::CommandStart(_, _) => {} - crate::eval::CommandEvent::Output(out) => { + tokio_pty_process_stream::Event::CommandStart { .. } => {} + tokio_pty_process_stream::Event::Output { data: out } => { let stdout = std::io::stdout(); let mut stdout = stdout.lock(); stdout.write(out).context(Print)?; stdout.flush().context(Print)?; } - crate::eval::CommandEvent::CommandExit(_) => {} + tokio_pty_process_stream::Event::CommandExit { .. } => {} + tokio_pty_process_stream::Event::Resize { .. } => {} } Ok(()) } |