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

alternate_screen_wrapper

enter end leave alternate screen in one line

2 releases

0.1.1 Oct 3, 2024
0.1.0 Aug 9, 2024

#350 in Command-line interface

Download history 90/week @ 2024-08-05 23/week @ 2024-08-12 3/week @ 2024-09-23 176/week @ 2024-09-30 10/week @ 2024-10-07 15/week @ 2024-10-14

204 downloads per month

MIT license

4KB
50 lines

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–8MB
~80K SLoC