Sometimes the small things make a big difference. I noticed that the control-left and control-right keys weren’t working in bash or Emacs on my FreeBSD box accessed over X11.app on OS X. Easily fixed.
.inputrc
"\e[1;5C": forward-word # Ctrl+right => forward word "\e[1;5D": backward-word # Ctrl+left => backward word
.emacs
(global-set-key "\M-[1;5C" 'forward-word) ; Ctrl+right => forward word (global-set-key "\M-[1;5D" 'backward-word) ; Ctrl+left => backward word

wow. is that standard on most shells?
Thanks, this helped me a lot.
Words cannot explain how useful this is for someone struggling to get gnome-terminal behave nicely with emacs!
Also, typing Ctrl-V followed by the key combination (say Ctrl-up arrow) at the shell prompt (in bash) reveals the code.
for my mac, if fixed the arrow right left problem by
“\e[5C”: forward-word # Ctrl+right => forward word
“\e[5D”: backward-word # Ctrl+left => backward word
Things are alright now
Thanks for your help
Thank you soo much. Spent like half an hour trying to get this to work in emacs.
Thank you!
Thanks! This probably saved me an hour today.
[...] a whole bunch of running in circles, I have discovered a combination that works (with these clues). I have my TERM variable set to xterm-color. I configured the Terminal.app using its Keyboard [...]
On OSX 10.6 the Spaces feature can claim the control-arrow keys.
That can be changed in the Expose and spaces settings.