File: alternate_screen.rs

package info (click to toggle)
rust-termion 1.5.6-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 308 kB
  • sloc: makefile: 10
file content (17 lines) | stat: -rw-r--r-- 471 bytes parent folder | download | duplicates (18)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
extern crate termion;

use termion::screen::*;
use std::io::{Write, stdout};
use std::{time, thread};

fn main() {
    {
        let mut screen = AlternateScreen::from(stdout());
        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.");
}