How to get C-` key combo recognized in Emacs under Mac?

130 views Asked by At

I use console Emacs in iTerm and Terminal.app. A package needs the key combo C-backtick which I can't get Emacs to receive through either of the terminal emulators. It's easy to confirm by using C-h k, and then typing C-backtick. It gives the result for the ` key instead.

Is there any way to get iTerm or Terminal.app to send this key combo properly?

1

There are 1 answers

2
Thomas Dickey On

The answer really depends on what you are expecting:

  • If you are looking for some behavior not in a terminal emulator, Emacs could detect the control modifier independently of the actual character.
  • In a terminal emulator, the usual effect of the control modifier is to logically-AND the value of the character with 0x1f (31). The ` character's value is 0x60 (96), so the usual result would be 0 (ASCII NUL). You can do this in Terminal.app with a control modifying the space character.

Just to complicate things a little, xterm can be told to send an escape sequence such as

ESC [ 2 7 ; 5 ; 9 6 ~

for control `, however that's not implemented by other terminal emulators. (This is the modifyOtherKeys feature mentioned in the manual).