Subject: specific key detection prevents generic recognition of Ctrl+Backarrow in modifyOtherKeys mode

From: Thomas Wolff <[email-masked]>
Date: Thu, 28 Jan 2021 18:33:54 +0100

Package: emacs
Version: 27.1

In text mode, emacs uses modifyOtherKeys mode (as introduced by xterm) 
to distinguish non-character modifier+key combinations. However, some 
terminals (e.g. mintty) may implement a slightly extended version of 
modifyOtherKeys mode. Mintty uses it also for Ctrl+Backarrow (which 
xterm doesn't), so this combination will not be recognised by emacs, and 
rather garbage (partial escape sequence) will be entered.
Ref: mintty issue 
https://github.com/mintty/mintty/issues/1082#issuecomment-769021784

Suggestion: emacs should apply generic detection of modifyOtherKeys mode 
escape sequences, so that all of them will be interpreted properly. 
Ctrl+Backarrow (where Backarrow is mapped to DEL) may be a special case 
as Ctrl+DEL may not have a meaning in emacs, so the typical remapping to 
Backspace should be applied in this case. Vice versa for the case that 
Backarrow is mapped to Backspace.

Note: browsing emacs docs and help pages, I could not find out whether a 
workaround is possible, something like
(global-set-key "\e[127;5u" ...) which does not work. Some notes on how 
to rebind unknown escape sequences should be added; in case that's not 
possible, the functionality should be added.