diff --git a/src/main.rs b/src/main.rs index de8ceb49..41957cc7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -66,7 +66,9 @@ fn start_application() { let mut siv = Cursive::new(); siv.add_global_callback('q', Cursive::quit); siv.add_global_callback(Key::Esc, |s| { - s.pop_layer(); + if s.pop_layer().is_none() || s.screen().len() == 0 { + s.quit(); + }; }); // get and apply the color theme