diff options
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/main.rs b/src/main.rs index d733f97..3ec964a 100644 --- a/src/main.rs +++ b/src/main.rs | |||
@@ -50,13 +50,11 @@ fn main() { | |||
50 | ), | 50 | ), |
51 | } | 51 | } |
52 | } else { | 52 | } else { |
53 | let mut s = termion().unwrap(); | ||
53 | let app = App::load_state(); | 54 | let app = App::load_state(); |
54 | let m = app.message.clone(); | ||
55 | unsafe { signal_hook::register(signal_hook::SIGINT, move || { | ||
56 | m.write().unwrap().set_message("Use the :q command to quit"); | ||
57 | }) }.unwrap(); | ||
58 | 55 | ||
59 | let mut s = termion().unwrap(); | 56 | // prevent Ctrl-C from killing the app and allow the app to override it. |
57 | s.clear_global_callbacks(cursive::event::Event::CtrlChar('c')); | ||
60 | 58 | ||
61 | let layout = NamedView::new( | 59 | let layout = NamedView::new( |
62 | "Frame", | 60 | "Frame", |
@@ -66,7 +64,6 @@ fn main() { | |||
66 | s.add_global_callback(':', |s| open_command_window(s)); | 64 | s.add_global_callback(':', |s| open_command_window(s)); |
67 | 65 | ||
68 | s.set_theme(theme::theme_gen()); | 66 | s.set_theme(theme::theme_gen()); |
69 | |||
70 | s.run(); | 67 | s.run(); |
71 | } | 68 | } |
72 | } | 69 | } |