The character with code 0x1B
(generated by Ctrl+[
) is not meant to be used directly by applications, because it was designed to serve as the signal which starts a control sequence. I never input control sequences by hand (does anybody do?), thus I do not need any keybinding to produce the escape code itself. So, I would prefer to use these buttons for something else. You see, these two buttons (Ctrl
and [
) occupy a convenient place on the keyboard and are thus convenient to type, and it's a pity that this keybinding is just wasted.
How do I make Ctrl+[
generate the control sequence of my choice? (both under X and under Wayland)
Ctrl+[
here is an alternate way of inputtingEscape
and is supplied by the terminal driver, not XKB (the keyboard-config layer in both modern X11 and Wayland).stty
will let you query and set terminal settings, but i dunno how you'd change that one without breaking things like ... the terminal. XKB would allow you to remap aCtrl
key to a modifier (egAlt
,Hyper
, orSuper
), but then it wouldn't act like aCtrl
key anywhere, which might not be what you want. see https://en.wikipedia.org/wiki/C0_and_C1_control_codes https://en.wikipedia.org/wiki/ANSI_escape_code – quixotic May 30 '17 at 03:010x1B
). I wonder how changing a keybinding may break the terminal – Igor Liferenko May 30 '17 at 03:22