Implement xterm key modifier options
Without modifier options it's hard, if not impossible, for apps to reliably detect keys with modifiers (Ctrl-a, Ctrl-Shift-a, etc)
In xterm and mintty, setting modifyOtherKeys
to 2 changes the way they report modified keys to something well defined.
I send \33[>4;2m
to xterm and get:
// ctrl-1 --->
hex: 1b 5b 32 37 3b 35 3b 34 39 7e
asc: . [ 2 7 ; 5 ; 4 9 ~
// ctrl-a --->
hex: 1b 5b 32 37 3b 35 3b 39 39 7e
asc: . [ 2 7 ; 5 ; 9 7 ~
Other modifiers also work. The format is CSI 27 ; (mod) ; (char) ~
In VTE, sending \33[>4;2m
does nothing, so I get:
// ctrl-1 is the same as just '1' --->
hex: 31
asc: 1
// ctrl-a and ctrl-shift-a --->
hex: 01
asc: .
Ascii 1 through 26 can be used for ctrl, but not very reliably. For example, hitting ctrl-j is like hitting enter.
I guess this function is worth implementing, and obviously the modifiers have to be mapped depending on the modes set here:
8679 void
8680 Terminal::XTERM_MODKEYS(vte::parser::Sequence const& seq)
8681 {
8682 /*
8683 * XTERM_MODKEYS - xterm set key modifier options
8684 *
8685 * Probably not worth implementing.
8686 */
8687 }
Thanks,
Yakov
Edited by Ghost User