When Emacs runs under terminal, it sees different names for certain keys compared to when it’s running as a GTK app (RET instead of <return>, TAB instead of <tab>, etc.) For some custom keybindings that involve these keys, I have to define them twice, one for the “GTK” form of return or tab, once for the “terminal” form. Also, org-mode appears to override the <tab> keybinding, but not the TAB binding, leading to inconsistent behavior. Is there a way to translate the “terminal” keys to the “GTK” keys (for lack of better terminology) or somehow avoid this mess otherwise?
When Emacs runs under terminal, it sees different names for certain keys compared to
Share
There is a system in place for situations like this. Emacs defines two keymaps
key-translation-mapandfunction-key-mapthat are intended to translate keys from one form to another.