Skip to content

Commit

Permalink
feat(term): handle ctrl-c
Browse files Browse the repository at this point in the history
  • Loading branch information
ymgyt committed Mar 17, 2024
1 parent 681a640 commit ef2842e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion crates/synd_term/src/application/mod.rs
Original file line number Diff line number Diff line change
@@ -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::{
Expand Down Expand Up @@ -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,
}
}
Expand Down

0 comments on commit ef2842e

Please sign in to comment.