diff --git a/src/input_handler.cc b/src/input_handler.cc index 51c88b57..8c0a7618 100644 --- a/src/input_handler.cc +++ b/src/input_handler.cc @@ -202,6 +202,15 @@ public: { ScopedSetBool set_in_on_key{m_in_on_key}; + // Hack to parse keys sent by terminals using the 8th bit to mark the + // meta key. In normal mode, give priority to a potential alt-key than + // the accentuated character. + if (key.key >= 127 and key.key < 256) + { + key.modifiers |= Key::Modifiers::Alt; + key.key &= 0x7f; + } + bool do_restore_hooks = false; auto restore_hooks = on_scope_end([&, this]{ if (m_hooks_disabled and enabled() and do_restore_hooks) diff --git a/src/ncurses_ui.cc b/src/ncurses_ui.cc index 974a2b68..d06258bf 100644 --- a/src/ncurses_ui.cc +++ b/src/ncurses_ui.cc @@ -485,6 +485,7 @@ void NCursesUI::check_resize(bool force) m_window = (NCursesWin*)newpad(ws.ws_row, ws.ws_col); intrflush(m_window, false); keypad(m_window, true); + meta(m_window, true); m_dimensions = DisplayCoord{ws.ws_row-1, ws.ws_col};