2017-02-27 12:42:55 +00:00
|
|
|
extern crate termion;
|
|
|
|
|
2021-06-08 17:59:01 +01:00
|
|
|
use termion::screen::IntoAlternateScreen;
|
2017-02-27 12:42:55 +00:00
|
|
|
use std::io::{Write, stdout};
|
|
|
|
use std::{time, thread};
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
{
|
2021-06-08 17:59:01 +01:00
|
|
|
let mut screen = stdout().into_alternate_screen().unwrap();
|
2017-02-27 12:42:55 +00:00
|
|
|
write!(screen, "Welcome to the alternate screen.\n\nPlease wait patiently until we arrive back at the main screen in a about three seconds.").unwrap();
|
|
|
|
screen.flush().unwrap();
|
|
|
|
|
|
|
|
thread::sleep(time::Duration::from_secs(3));
|
|
|
|
}
|
|
|
|
|
|
|
|
println!("Phew! We are back.");
|
|
|
|
}
|