From fb9dbfed2a903fbf38f37db904c960d69973fb8b Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Fri, 28 May 2021 20:15:56 +1000 Subject: [PATCH] Canonicalize into uppercase in csi key parsing code Fixes #4159 --- src/ncurses_ui.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/ncurses_ui.cc b/src/ncurses_ui.cc index 18be7bd2..31c5269a 100644 --- a/src/ncurses_ui.cc +++ b/src/ncurses_ui.cc @@ -725,7 +725,13 @@ Optional NCursesUI::get_next_key() auto masked_key = [&](Codepoint key) { int mask = std::max(params[1] - 1, 0); - return Key{parse_mask(mask), key}; + Key::Modifiers modifiers = parse_mask(mask); + if (is_basic_alpha(key) and (modifiers & Key::Modifiers::Shift)) + { + modifiers &= ~Key::Modifiers::Shift; + key = to_upper(key); + } + return Key{modifiers, key}; }; switch (c)