2019-01-28 07:16:14 +11:00
|
|
|
extern crate crossterm_screen;
|
|
|
|
|
2019-04-11 07:46:30 +10:00
|
|
|
use crossterm_screen::AlternateScreen;
|
2019-01-28 07:16:14 +11:00
|
|
|
|
|
|
|
use std::io::{stdout, Write};
|
|
|
|
use std::{thread, time};
|
|
|
|
|
|
|
|
/// print wait screen on alternate screen, then switch back.
|
|
|
|
pub fn print_wait_screen_on_alternate_window() {
|
|
|
|
// move to alternate screen, 'false' means if the alternate screen should be in raw modes.
|
2019-04-11 07:46:30 +10:00
|
|
|
if let Ok(alternate) = AlternateScreen::to_alternate(false) {
|
2019-01-28 07:16:14 +11:00
|
|
|
// do some stuff on the alternate screen.
|
|
|
|
} // <- alternate screen will be disabled when dropped.
|
|
|
|
}
|