html terminal
Diffstat (limited to 'src/process.rs')
| -rw-r--r-- | src/process.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/process.rs b/src/process.rs index c13332c..6950297 100644 --- a/src/process.rs +++ b/src/process.rs @@ -46,8 +46,7 @@ impl Process { match input.try_recv() { Err(e) => match e { TryRecvError::Closed => fail!("closed"), - TryRecvError::Lagged(_) => continue, - TryRecvError::Empty => {} + _ => sleep(Duration::from_millis(100)).await, }, Ok(mut s) => { input!("{s}"); @@ -60,7 +59,7 @@ impl Process { let string = { let n = tokio::select! { n = self.inner.read(&mut stdout) => n.unwrap(), - _ = sleep(Duration::from_millis(500)) => continue, + _ = sleep(Duration::from_millis(100)) => continue, }; String::from_utf8_lossy(&strip_ansi_escapes::strip(&stdout[..n])).into_owned() }; @@ -68,7 +67,7 @@ impl Process { output!("{line}"); } output.send(string).unwrap(); - sleep(Duration::from_millis(500)).await; + sleep(Duration::from_millis(100)).await; } }) } |