1

I'm an Emacs user, and I use it exclusively in the terminal. I'm trying to type C-c C-, because there's an important command bound to it. However, whenever I try and hit C-,, it comes through just as ,.

I'm running on Ubuntu Linux, I think my desktop is Gnome. (I usually develop on macOS, but I can't in this case.)

5
  • 1
    Are you using the graphical or terminal-based emacs version? Sep 26, 2019 at 9:13
  • @grawity Updated question: I use it in the terminal. Sep 26, 2019 at 9:15
  • Do you have access to a macOS system right now? What do you get in a terminal after pressing Ctrl+V Ctrl+, ? Sep 26, 2019 at 9:37
  • OK, same issue on macOS: Ctrl+, doesn't seem to work. I just get ",". Also, Ctrl+V (capital "V", yes?) just moves down a page like normal. Maybe my terminal has a restricted set of control characters that it can accept? Sep 26, 2019 at 9:43
  • I meant in a regular shell, not in Emacs (and yes, Ctrl+V is actually the same as Ctrl+Shift+v). Sep 26, 2019 at 9:46

1 Answer 1

2

It's not supported by your terminal, and most likely it's not supported by any terminal (except through manual configuration).

Terminals handle Ctrl+keys in two ways:

  • For letters – by clearing bits 7 and 6 of the letter's ASCII value, e.g. V is binary 0101'0110 while Ctrl+V is sent as binary 0001'0110. (This is also why Ctrl+letter and Ctrl+Shift+letter do the same; bit 6 is the one that indicates uppercase status, so they produce the same code.)
  • For special keys – by sending an agreed-upon "escape sequence", such as ESC [1;5C for Ctrl+Right.

(Here "letters" really covers the entire ASCII 0x40–0x7F range, so it includes a few special characters such as Ctrl+] or Ctrl+\.)

The first case cannot be used for comma (binary 0010'1100) because the resulting code would be completely indistinguishable from the one used for Ctrl+L (binary 01?0'1100) – both would just result in the same 0000'1100 byte.

The second case cannot be used simply because no one has added a special key code for Ctrl+, in your terminal yet. It is technically possible, but you would have to patch both the terminal emulator and Emacs to agree on the new code sequence. (Some users do this by "borrowing" a rarely used sequence such as F13/F14/… keys.)

See also:

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .