feat: interrupt running task on ctrl-z (#1880)
- Arguably a bugfix as previously CTRL-Z didn't do anything. - Only in TUI mode for now. This may make sense in other modes... to be researched. - The TUI runs the terminal in raw mode and the signals arrive as key events, so we handle CTRL-Z as a key event just like CTRL-C. - Not adding UI for it as a composer redesign is coming, and we can just add it then. - We should follow with CTRL-Z a second time doing the native terminal action.
This commit is contained in:
@@ -238,6 +238,16 @@ impl App<'_> {
|
||||
}
|
||||
}
|
||||
}
|
||||
KeyEvent {
|
||||
code: KeyCode::Char('z'),
|
||||
modifiers: crossterm::event::KeyModifiers::CONTROL,
|
||||
kind: KeyEventKind::Press,
|
||||
..
|
||||
} => {
|
||||
if let AppState::Chat { widget } = &mut self.app_state {
|
||||
widget.on_ctrl_z();
|
||||
}
|
||||
}
|
||||
KeyEvent {
|
||||
code: KeyCode::Char('d'),
|
||||
modifiers: crossterm::event::KeyModifiers::CONTROL,
|
||||
|
||||
Reference in New Issue
Block a user