Question

I have the following keyboard shortcut in my init.el

(global-set-key (kbd "C-S-<up>") 'move-line-up)

This works great in Cocoa Emacs.app, but when running emacs in console mode in iTerm2 it seems that they keys never make it to emacs.

I tried running the following in emacs

(read-key-sequence "?")

And entering C-S-<up> in the prompt but it was never received. That makes me think that either iTerm2 or zsh is stealing the keystrokes. Any ideas on how to debug this? Or better yet answers?

Was it helpful?

Solution

My guess would be that it's iTerm intercepting things.

You might find this site helpful. It says:

Select Profiles > Open Profiles… from the menu bar, or press Command-O and take a look at the default profile. Click on the Keys section. While you are here verify you have Left Option and Right Option as +Esc.

For the arrow key fixes though you will need to add a series of key shortcuts. The easiest way to get started is select Load Preset… > xterm Defaults

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top