ctrl+l support

This commit is contained in:
pap
2025-08-09 12:16:43 +01:00
parent e87974ae83
commit bf3f92dbb0
+21
View File
@@ -236,6 +236,27 @@ impl App<'_> {
self.app_event_tx.send(AppEvent::ExitRequest);
}
},
KeyEvent {
code: KeyCode::Char('l'),
modifiers: crossterm::event::KeyModifiers::CONTROL,
kind: KeyEventKind::Press,
..
} => {
// Clear terminal, move cursor to (0,0) then clear all to wipe anything above.
// Keep composer area visible including the prompt and cursor position.
let mut area = terminal.viewport_area;
area.y = 0;
terminal.set_viewport_area(area);
let _ = terminal.set_cursor_position((0, 0));
let _ = terminal
.backend_mut()
.clear_region(ratatui::backend::ClearType::All);
let _ = terminal.clear();
self.app_event_tx.send(AppEvent::RequestRedraw);
}
KeyEvent {
code: KeyCode::Esc,
kind: KeyEventKind::Press,