mirror of
https://github.com/hanzoai/dev.git
synced 2026-10-25 03:32:32 +00:00
fix(tui/keys): route Ctrl+Z to composer undo in Chat; keep suspend on non-chat screens
Previously Ctrl+Z always triggered Unix job control (suspend), preventing in-app undo. Now, when in Chat, we forward Ctrl+Z to the widget so the TextArea can perform an undo; Onboarding still suspends on Unix.
This commit is contained in:
+13
-4
@@ -564,11 +564,20 @@ impl App<'_> {
|
||||
kind: KeyEventKind::Press,
|
||||
..
|
||||
} => {
|
||||
#[cfg(unix)]
|
||||
{
|
||||
self.suspend(terminal)?;
|
||||
// Prefer in-app undo in Chat (composer) over shell suspend.
|
||||
match &mut self.app_state {
|
||||
AppState::Chat { widget } => {
|
||||
widget.handle_key_event(key_event);
|
||||
self.app_event_tx.send(AppEvent::RequestRedraw);
|
||||
}
|
||||
AppState::Onboarding { .. } => {
|
||||
#[cfg(unix)]
|
||||
{
|
||||
self.suspend(terminal)?;
|
||||
}
|
||||
// No-op on non-Unix platforms.
|
||||
}
|
||||
}
|
||||
// No-op on non-Unix platforms.
|
||||
}
|
||||
KeyEvent {
|
||||
code: KeyCode::Char('r') | KeyCode::Char('t'),
|
||||
|
||||
Reference in New Issue
Block a user