0

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?

  • Similar question on [emacs.se]: [http://emacs.stackexchange.com/questions/13950/c-s-n-and-c-not-working-in-emacs-if-running-within-terminal](http://emacs.stackexchange.com/questions/13950/c-s-n-and-c-not-working-in-emacs-if-running-within-terminal) – Gilles 'SO- stop being evil' Jul 13 '15 at 22:29

1 Answers1

0

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).

Thomas Dickey
  • 51,086
  • 7
  • 70
  • 105
  • Thanks. iTerm allows me to send arbitrary escape sequences, but when I tried the sequence you mentioned, it did not work. Can you confirm the sequence is correct? –  Jun 08 '15 at 13:52
  • The sequence shown was *sent* by xterm when `modifyOtherKeys` was set (by a control sequence). Neither Terminal nor iTerm2 recognizes the sequence. – Thomas Dickey Jun 09 '15 at 01:21