In iTerm while using emacs the META key sometimes sends ESC (OSX 10.10.4)
iTerm v. Build 2.1.1
OSX v. 10.10.4
Emacs v. 24.5.1
Works fine in the shell.
It almost works as intended in emacs but not always.
Here's an example.
Pressing OPTION + F makes the cursor skip ahead a word.
Pressing OPTION + Delete deletes a whole word.
but...
pressing OPTION + UP (arrow) throws the error
"ESC <down> is undefined"
That's weird. It works fine in Terminal, but not iTerm. Why is it sending the ESC key with both option keys and escape, even though i have them defined as different things.
What do?
Config stuff:
iTerm Preferences > Profile > Keys
Left option key acts as: +Esc
Right option key acts as: Meta
Terminal Preferences > Profiles > Keyboard
Use Option as Meta key (checked)
System Preferences > Keyboard > Modifier Keys
Caps Lock: Control
Control Key: Caps Lock
Option Key: Option
~/.emacs
(setq x-select-enable-clipboard t)
(define-key input-decode-map "\e\eOA" [(meta up)])
(define-key input-decode-map "\e\eOB" [(meta down)])
without those two define-key input-decode-map lines, the behavior in Terminal is the same (erroneous) behavior as in iTerm.