Skip to content

Commit

Permalink
feat(ui): add Ctrl-C as an alternative keyboard input to quit the app (
Browse files Browse the repository at this point in the history
…#91)

Needed as `crossterm` handles SIGINT
  • Loading branch information
fujiapple852 committed May 18, 2022
1 parent 0b658da commit d2121da
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/frontend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ fn run_app<B: Backend>(
if let Event::Key(key) = event::read()? {
match (key.code, key.modifiers) {
(KeyCode::Char('q'), _) if !app.show_help => return Ok(()),
(KeyCode::Char('c'), KeyModifiers::CONTROL) if !app.show_help => return Ok(()),
(KeyCode::Char('q'), _) if app.show_help => app.toggle_help(),
(KeyCode::Char('h'), _) => app.toggle_help(),
(KeyCode::Char('f'), _) if !app.show_help => app.toggle_freeze(),
Expand Down

0 comments on commit d2121da

Please sign in to comment.