From d6479e3c7e937bdaaa7208bad3efa5a67a62842e Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Tue, 13 Oct 2026 18:04:36 +0000 Subject: [PATCH] Fix Meta with escape sequences (e.g. Meta+Up) Terminals send Meta+key as ESC followed by the key, so Meta+Up is `ESC ESC [ A`. Since the esc delay support, `setMetaRoutine` parsed the escape sequence after the second ESC with `escRoutine` but discarded the result, and then dispatched the second ESC again: Meta+Up and other Meta+special-key combinations were not recognized, and the rest of the sequence was misinterpreted. Return the result of `escRoutine`, as it was before. Co-Authored-By: Claude Opus 5.5 --- src/escape.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/escape.cxx b/src/escape.cxx index b179c33..edbb8b7 100644 --- a/src/escape.cxx +++ b/src/escape.cxx @@ -870,7 +870,7 @@ static CharacterDispatch initialDispatch = {2, "\x1B\x7F", initialRoutines}; static char32_t setMetaRoutine(Terminal& terminal_, int err_fd_, char32_t c, int escDelay) { thisKeyMetaCtrl = Replxx::KEY::BASE_META; if (c == 0x1B) // another ESC, stay in ESC processing mode - escRoutine(terminal_, err_fd_, c, escDelay); + return escRoutine(terminal_, err_fd_, c, escDelay); return doDispatch(terminal_, err_fd_, c, initialDispatch, escDelay); }