0

I have been trying to make a keyboard binding in tmux's root key-table (no prefix) for Ctrl-Alt-;, but haven't been able to get it to work.

I then realised that in bash Ctrl-v, Ctrl-; returns only ;, so typing Ctrl-Alt-; is the same as typing Alt-;.

So is it not possible to use Ctrl-; at all in Linux? Is there anything I could do to make it work?

I am using a UK keyboard if that is making any difference here.

paradroid
  • 1,159
  • 1
  • 13
  • 28
  • 2
    You can configure your terminal emulator to send a special sequence upon pressing `Ctrl-;`. If your terminal supports it (xterm and mlterm do support it). Your keyboard layout does not make any difference. –  Oct 05 '21 at 23:43
  • 1
    This answers your question: [Why can't Emacs running in a terminal distinguish Ctrl+; from ";"?](https://unix.stackexchange.com/questions/161719/why-cant-emacs-running-in-a-terminal-distinguish-ctrl-from) – Thomas Dickey Oct 05 '21 at 23:44
  • 1
    Expanding on Cocaine Mitch's comment, you can configure some terminal emulators to send a different thing when `;`, `ctrl+;`, `ctrl+alt+;`, ..., well, different keys + mods are pressed. Luckily we are not stuck in 1980. If you are interested, see my Q&A: [Mapping otherwise conflicting or unmappable keys in terminal Vim](https://unix.stackexchange.com/questions/631241/mapping-otherwise-conflicting-or-unmappable-keys-in-terminal-vim) (it's not really Vim specific, I must change that title). – Quasímodo Oct 06 '21 at 00:31
  • @Quasímodo Thanks. I use Alacritty. It's easy enough to bind keys in the config. but I just don't know what I am supposed to bind it to. – paradroid Oct 06 '21 at 02:14
  • 2
    Does this answer your question? [Mapping otherwise conflicting or unmappable keys in terminal Vim](https://unix.stackexchange.com/questions/631241/mapping-otherwise-conflicting-or-unmappable-keys-in-terminal-vim) – AdminBee Oct 06 '21 at 07:57
  • @AdminBee That is the same link the Quasimodo gave immediately above and my response still stands. – paradroid Oct 06 '21 at 13:11
  • @paradroid That is the standard auto-generated comment when a question is a suspected duplicate. It seems I misunderstood your response to Quasimodos suggestion. – AdminBee Oct 06 '21 at 13:21
  • @Quasímodo I have been trying to look into tmux user-keys from your earlier comment that you deleted, but confused about why you mentioned `"\e[88;5u"`, as isn't that `ctrl+shift+x`? How would I find the code for `ctrl-alt-;`? – paradroid Oct 08 '21 at 20:03
  • 1
    Sorry, I thought it was wrong but it wasn't (I made a mistake when putting it in .tmux.conf). Anyway, in the linked question you find how to find the code for `ctrl-alt-;` — not that it matters, because, if you bind `ctrl-alt-;` to `\e[88;5u` the terminal emulator will respect your order none the wiser. Should you need help, feel free call me to a chat room. – Quasímodo Oct 09 '21 at 15:46

0 Answers0