From bf3f92dbb0d40cf3ecbb7b6af6f16bc3c5018091 Mon Sep 17 00:00:00 2001 From: pap Date: Sat, 9 Aug 2025 12:16:43 +0100 Subject: [PATCH] ctrl+l support --- codex-rs/tui/src/app.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/codex-rs/tui/src/app.rs b/codex-rs/tui/src/app.rs index a97948f3ea..df65a33787 100644 --- a/codex-rs/tui/src/app.rs +++ b/codex-rs/tui/src/app.rs @@ -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,