2

I'm trying to execute C-M-- from Emacs on Terminal (iTerm2) running on OSX, but I keep getting an error saying C-M-_ is undefined. Any ideas how to workaround this?

Galder Zamarreño
  • 1,527
  • 2
  • 12
  • 21
  • 1
    Using `M--` works, but makes it a bit awkward for scrolling up on other window. Note that this is Emacs Terminal and hence `C-M-S-v` does not work. – Galder Zamarreño Jul 03 '15 at 18:11
  • possible duplicate of [Shift+Up isn't recognized by Emacs in a terminal](http://emacs.stackexchange.com/questions/977/shiftup-isnt-recognized-by-emacs-in-a-terminal) – PythonNut Aug 03 '15 at 19:59
  • @PythonNut Not a duplicate. http://emacs.stackexchange.com/questions/977/shiftup-isnt-recognized-by-emacs-in-a-terminal is definitely useful background, but an answer to this question would explain how to set up iTerm2. Hmm, I've done that before. – Gilles 'SO- stop being evil' Aug 03 '15 at 22:02
  • possible duplicate of [Problems with keybindings when using terminal](http://emacs.stackexchange.com/questions/1020/problems-with-keybindings-when-using-terminal) – Gilles 'SO- stop being evil' Aug 03 '15 at 22:03
  • @Gilles @PythonNut can you be more specific how this is a duplicate? And @Gilles, any specific ideas on how to solve this? Looking at the output of `C-h l`, I see `ESC C-_` being printed out when I execute `C-M--` – Galder Zamarreño Aug 04 '15 at 11:36
  • @GalderZamarreño So configure the iTerm2 binding for Ctrl+Meta+-. – Gilles 'SO- stop being evil' Aug 04 '15 at 12:18

1 Answers1

0

I eventually got this working by going into iTerm2 preferences and adding a new global shortcut key binding where I entered as Keyboard Shortcut ^⌥-, chose Action Send Escape Sequence and just typed - in the Esc+ field. That seems to do the trick.

Thanks @Gilles and @PythonNut for their help :)

Galder Zamarreño
  • 1,527
  • 2
  • 12
  • 21
  • If you're satisfied with this answer, could you please accept it so we can mark it as answered? – Dan Oct 04 '15 at 15:51