From ef2842e2cdd1bf4e0468e69e5cdea06869fa17b3 Mon Sep 17 00:00:00 2001 From: ymgyt Date: Sun, 17 Mar 2024 19:29:48 +0900 Subject: [PATCH] feat(term): handle ctrl-c --- crates/synd_term/src/application/mod.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/synd_term/src/application/mod.rs b/crates/synd_term/src/application/mod.rs index 451f2e88..72b1c93d 100644 --- a/crates/synd_term/src/application/mod.rs +++ b/crates/synd_term/src/application/mod.rs @@ -1,6 +1,6 @@ use std::{pin::Pin, time::Duration}; -use crossterm::event::{Event as CrosstermEvent, KeyCode, KeyEvent, KeyEventKind}; +use crossterm::event::{Event as CrosstermEvent, KeyCode, KeyEvent, KeyEventKind, KeyModifiers}; use futures_util::{FutureExt, Stream, StreamExt}; use ratatui::{style::palette::tailwind, widgets::Widget}; use synd_auth::device_flow::{ @@ -553,6 +553,9 @@ impl Application { }; match key.code { KeyCode::Char('q') => Some(Command::Quit), + KeyCode::Char('c') if key.modifiers == KeyModifiers::CONTROL => { + Some(Command::Quit) + } _ => None, } }