2

I have been trying to get the following key binding to work in emacs running in a mac terminal.

(define-key c-mode-base-map (kbd "C-`") 'ac-complete-clang)      

It never worked. At first, I think i got the way of defining the key binding wrong. But I later verified that it worked with some simpler key binding, e.g. M-_. Now I realize that it is the terminal that is not recognizing C-` and many more control key related key binding.

Can someone tell me how I get this to work? Where can I see how Terminal takes when I press C-` and how I should pass this along so that emacs will recognize it?

phils
  • 71,335
  • 11
  • 153
  • 198
  • Perhaps that can be set in the Terminal.app preferences? See the following link: http://stackoverflow.com/a/21949369/2112489 It looks like you can add your own stuff with the + key. – lawlist Jun 28 '14 at 00:37
  • Also see [Send “C-(” to Emacs in VT100/xterm terminal (Mac OS X's Terminal)?](http://stackoverflow.com/q/4337837/324105) and [howto send emacs control-quote (C-') via terminal (iTerm2)](http://stackoverflow.com/questions/20874190/howto-send-emacs-control-quote-c-via-terminal-iterm2). I don't use OSX, so it's not clear to me whether these or lawlist's link constitute duplicates. – phils Jun 28 '14 at 02:01
  • as noticed in the comments to this link, it seems only keys like arrows, delete, can be mapped. I still don't see why ctrl + ` can't be passed by Terminal. – user3784386 Jun 28 '14 at 02:06
  • It's an emulator, and the thing it's emulating had no `C-\``. The vast majority of terminal emulators are likewise limited for the same reason. – phils Jun 28 '14 at 17:04

0 Answers0