I have just switched from using Emacs.app to emacs server and emacsclient in terminal mode using iterm2 as my terminal emulator. I am having some trouble with some keybindings though. Particularly M-left arrow prints the character D, M-right arrow prints C, M-up arrow prints A, and M-down arrow prints B. M-ret seems to work though, at least for org mode. I am using the xterm defaults for keys in iterm2 and have the left and right option keys bound to +Esc. I can get the M-left functionality in org-mode with Esc-left or Esc-right This is particularly annoying in org-mode. Am I going to have to just rebind the keys in my .emacs? How would I go about doing that?
I have looked at this http://orgmode.org/manual/TTY-keys.html#TTY-keys, but I don't understand why the arrow keys should be unavailable in the terminal.
edit:
Cat meta-up: ^[[1;9A
Cat meta-down: ^[[1;9B
Cat meta-right: ^[[1;9C
Cat meta-left: ^[[1;9D
Main problem solved, but I am now having trouble with shift-up
. "<select> undefined"
. I tried a similar mapping with the escape sequence I got from cat
: ^[[1;2A
. Reluctant to create another question for a similar problem.