I am trying to use the key "shift-tab" in emacs running purely under Terminal.app, but got an error saying there is no keybinding for "M-[ z" (where M is the meta key, set to be the option key under Terminal.app preferences). In other words, emacs thinks I am pressing "option-[ z" when I pressed "shift-tab" on the keyboard of my MacBook Pro running Mac OS X 10.6.6, what is the problem and how do I correct it? Thank you.
Mac – Weird keybindings in Mac OS X Terminal.app
emacskeyboardmetadataterminal
Related Question
- keyboard – How to Send Control-Slash to Terminal
- Mac – On OS X Lion 10.7.4 in Terminal.app I cannot type `C-M-@` or `C-M-%`, why
- MacOS – Making MacBook command-key the Emacs meta-key under VMware/Windows
- MacOS – changing the meta key in emacs
- MacOS – running emacs on a terminal: problem with meta-key
- High Sierra – How to Disable Lock-Screen Hotkey (Command-Ctrl-Q)
Best Answer
Terminal.app is actually doing what it's supposed to:
shift-TAB
sendsESC [ z
which Emacs reads asM-[ z
. The problem is that the terminal description forxterm-color
(the one usually used with Terminal.app and other terminal emulators) is missing thekcbt
declaration, so Emacs doesn't know that that's what the key sends.There are two ways to fix this:
Edit the terminal description:
Tell Emacs about it directly:
The problem in both cases is that there doesn't seem to be a
backwards-tab
command to substitute forsomething
. Emacs.app binds backtab toyank
; what do you want it to do?