From 52a5da51bf9b17131cdc1e3d0d8b9f2c75472d59 Mon Sep 17 00:00:00 2001 From: Zaggy1024 Date: Thu, 3 Nov 2022 17:59:41 -0500 Subject: [PATCH] LibVT: Make shortcuts propagate completely before terminal input This allows shorcuts to be used in the Terminal app rather than processing the terminal input first and ignoring shortcuts after. --- Userland/Libraries/LibVT/TerminalWidget.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Userland/Libraries/LibVT/TerminalWidget.cpp b/Userland/Libraries/LibVT/TerminalWidget.cpp index c7a8b1e272..2086215e0f 100644 --- a/Userland/Libraries/LibVT/TerminalWidget.cpp +++ b/Userland/Libraries/LibVT/TerminalWidget.cpp @@ -206,8 +206,13 @@ void TerminalWidget::event(Core::Event& event) void TerminalWidget::keydown_event(GUI::KeyEvent& event) { + // We specifically need to process shortcuts before input to the Terminal is done + // since otherwise escape sequences will eat all our shortcuts for dinner. + window()->propagate_shortcuts_up_to_application(event, this); + if (event.is_accepted()) + return; + if (m_ptm_fd == -1) { - event.ignore(); return GUI::Frame::keydown_event(event); }