From 6f1e1fb3cf9bb29ba3bca392d210e24f1e2de8a4 Mon Sep 17 00:00:00 2001 From: Greg Shuflin Date: Thu, 16 Nov 2023 21:13:15 -0800 Subject: [PATCH] sneakers: clear screen --- src/lib.rs | 2 +- src/sneakers.rs | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 474daf1..f2b06e1 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -70,7 +70,7 @@ pub extern "C" fn rust_main() { if args.clear_screen { unsafe { - nmstermio_set_clearscr(2); + nmstermio_set_clearscr(1); } } diff --git a/src/sneakers.rs b/src/sneakers.rs index 1b9c553..243b25c 100644 --- a/src/sneakers.rs +++ b/src/sneakers.rs @@ -19,6 +19,11 @@ const foot2Center: &str = "[ ] Select Option or ESC to Abort"; pub extern "C" fn rust_sneakers_effect() { use std::time::Duration; + + unsafe { + crate::nmstermio_set_clearscr(1); + } + let (term_width, _term_height) = crossterm::terminal::size().expect("Error reading terminal size"); let term_width = term_width as usize; let mut buf = String::new();