#screen #leave #enter #end #line #alternate-screen

alternate_screen_wrapper

enter end leave alternate screen in one line

1 unstable release

0.1.0 Aug 9, 2024

#280 in Graphics APIs

23 downloads per month

MIT license

3KB

Cargo.toml

alternate_screen_wraper = { version = "<current-version>", features = "crossterm" } # or other backand

main.rs

fn main() {
    let alternate_screen = alternater_screen_wrapper::AlternateScreen::enter();
    // ..do some work
    let printable = // do other work
    // 
    drop(alternate_screen);
    println!("{printable}"); // it works
}

You can don't call drop manually. It will be dropped automatically when you exiting scope or panicing.

Dependencies

~0–8.5MB
~81K SLoC