#console #window #closing #dont #ends #wait #command

dont_disappear

Tiny crate that prevents the console window from closing when the program finishes

28 releases (18 stable)

3.0.1 Jan 3, 2020
3.0.0 Jan 2, 2019
2.2.1 Jan 2, 2019
2.2.0 Nov 25, 2018
0.0.10 Sep 17, 2018

#1 in #ends

Download history 236/week @ 2024-06-17 229/week @ 2024-06-24 151/week @ 2024-07-01 207/week @ 2024-07-08 251/week @ 2024-07-15 300/week @ 2024-07-22 640/week @ 2024-07-29 282/week @ 2024-08-05 320/week @ 2024-08-12 176/week @ 2024-08-19 242/week @ 2024-08-26 213/week @ 2024-09-02 458/week @ 2024-09-09 205/week @ 2024-09-16 368/week @ 2024-09-23 250/week @ 2024-09-30

1,295 downloads per month
Used in 6 crates

MIT/Apache

180KB

Don't Disappear

Tiny crate that prevents the console window from closing when the program finishes. pipeline status License Latest version Latest Docs downloads-badge

Why you need it.

When making an app without a GUI sometimes you display some information before the program ends. If you send this program to someone and they run it in the windows command prompt or some other console the window may close before showing the data. This crate allows the user to wait until they have read the data before they close the window.

Example of Don't Disappear in action Don't Disappear in action preventing data form disappearing when a program ends.

Help

If you run into any issues or need help with using dont_disappear in your project please email incoming+efunb/dont_disappear@incoming.gitlab.com

How to use example.

This is one example of one of the ways you could use one of the dont_disappear functions.

extern crate dont_disappear;

fn main() {
    println!("Here is some data");
    dont_disappear::any_key_to_continue::default();
}

Features

Close with any key.

Close with enter key.

Close with window manager.

Examples

Any key to continue

Raw

Download example for Windows

Download example for Linux

cargo run --example any_key_to_continue

Enter to continue

Raw

Download example for Windows

Download example for Linux

cargo run --example enter_to_continue

Close with window manager.

Raw

Download example for Windows

Download example for Linux

cargo run --example press_close

Docs

API Documentation

Dependencies

This project uses crossterm in the any_key_to_continue module.

Downloads

All examples Windows

All examples Linux

Warning

If you are viewing this from GitHub then this is a read only copy. Please contribute to the GitLab copy here.

Dependencies

~485–700KB
~10K SLoC