Implemented the pause in tmux in a different way

This commit is contained in:
Roey Darwish Dror
2019-06-13 09:21:39 +03:00
parent 9430ab30f6
commit e5d0f4cbfa
3 changed files with 49 additions and 23 deletions

View File

@@ -139,6 +139,11 @@ impl Terminal {
answer
}
fn pause(&self) -> Result<(), io::Error> {
self.term.read_char()?;
Ok(())
}
}
impl Default for Terminal {
@@ -169,3 +174,7 @@ pub fn print_result<P: AsRef<str>>(key: P, succeeded: bool) {
pub fn is_dumb() -> bool {
TERMINAL.lock().unwrap().width.is_none()
}
pub fn pause() {
TERMINAL.lock().unwrap().pause().unwrap();
}