From 8a4ed096ed6856c2bf9dde59901f23eaf8d89da0 Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Sun, 30 Jan 2022 11:29:35 -0800 Subject: [PATCH] Stop passing check_exit events to match key bindings check_exit events are generated to give the reader a chance to respond to commands, or otherwise to return control to the reader loop. Prior to this change they were being passed to match key bindings. This is useless since no key binding can match a check_exit event. FLOG noisily complains about unmatched events. So just don't pass these to mapping_execute. --- src/input.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/input.cpp b/src/input.cpp index 75a9522ba..35ad325b4 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -673,9 +673,6 @@ void inputter_t::mapping_execute_matching_or_generic(const command_handler_t &co FLOGF(reader, L"no generic found, ignoring char..."); auto evt = peeker.next(); - if (evt.is_eof()) { - this->push_front(evt); - } peeker.consume(); } @@ -750,7 +747,11 @@ char_event_t inputter_t::read_char(const command_handler_t &command_handler) { // If we have EOF, we need to immediately quit. // There's no need to go through the input functions. return evt; + } else if (evt.is_check_exit()) { + // Allow the reader to check for exit conditions. + return evt; } else { + assert(evt.is_char() && "Should be char event"); this->push_front(evt); mapping_execute_matching_or_generic(command_handler); // Regarding allow_commands, we're in a loop, but if a fish command is executed,