Module termion::screen

source ·
Expand description

Managing switching between main and alternate screen buffers.

Note that this implementation uses xterm’s new escape sequences for screen switching and thus only works for xterm compatible terminals (which should be most terminals nowadays).

§Example

use termion::screen::AlternateScreen;
use std::io::{Write, stdout};

fn main() {
    {
        let mut screen = AlternateScreen::from(stdout());
        write!(screen, "Writing to alternate screen!").unwrap();
        screen.flush().unwrap();
    }
    println!("Writing to main screen.");
}

Structs§

  • A terminal restorer, which wraps a type implementing Write, and causes all writes to be written to an alternate screen.
  • Switch to the alternate screen buffer of the terminal.
  • Switch to the main screen buffer of the terminal.