Why does Terminal swallow Ctrl+up/down keystrokes

itermkeyboardsnow leopardterminal

In Terminal.app on Snow Leopard, the key combinations Ctrl+ and Ctrl+ don't get passed through correctly. Instead Terminal.app receives a single or key stroke.

I have verified this by running cat -v, which prints the code ^[[A for both Ctrl+ and , and the code ^[[B for both Ctrl+ and .

I have looked through the keyboard shortcut settings in System Preferences, but nothing is mapped to them. Furthermore, the keystrokes work in MacVim (I first noticed this issue when these keystrokes didn't work for me in vim in the terminal).

I'm also running iTerm2, which doesn't receive Ctrl+ or Ctrl+ at all (as tested with cat -v).

Where can I figure out what's eating my Ctrl+ and Ctrl+ keystrokes in Terminal.app and iTerm2?

Best Answer

In the Terminal preferences, go to Settings and select Keyboard in the panel. There you can set various key combinations to send whatever string you wish to the shell (or the program currently running).