1

By default the prefix with which one switches focus to Tmux for command entry is C-b (ctrl + b). This is a key combination. I would like to, instead, use a key sequence. I would like to doublepress the control key (C C (ctrl ctrl)).

How can this be achieved?

tjfwalker
  • 494
  • 3
  • 18

1 Answers1

3

Generally speaking, you cannot do this: terminals use Control as a modifier (something done in combination with other key(s). Repeating a modifier has no effect.

There are several aspects to this:

  • tmux (like screen) runs in a conventional terminal. The fact that tmux is a curses application while screen is a termcap application makes no difference, since both are for the same type of terminal.
  • the terminals are conventional in the sense that they are either hardware terminals such as a DEC VT100, or emulate (act like) a hardware terminal.
  • all of these ("real" terminals and terminal emulators) are designed to send characters, such as US-ASCII (essentially the POSIX character set, along with control characters).
  • to be able to send these characters, some keys were assigned the role of modifiers. That is, they are used only in combination with other keys to modify the value sent.
  • examples of modifier keys include: Shift, Control, NumLock, Alt.
  • while there are graphical applications (such as the xev X Window application) that can read separate key-press and key-release events for almost any key on a keyboard, terminal emulators use a keyboard configuration which combines these, along with modifier keys. Applications running in the terminal emulator see only the effects of key-presses, modified to reflect which shift-, control-, etc., modifier key you are using.
  • a few special cases exist, such as the Linux console for which an application can make system calls to get some of the event information. However, applications (back to tmux and screen) which are written for conventional terminals do not use these special cases. That is because the specialized information would be only available on certain terminals, while the applications are designed to be able to attach (and run seamlessly) on any (conventional) terminal).

Regarding the special function calls, that has been asked before, e.g.,

Community
  • 1
  • 1
Thomas Dickey
  • 51,086
  • 7
  • 70
  • 105