4

I'd like to be able to set my tmux prefix to be a double-press of a letter key (k, maybe), rather than a ctrl+something key combination.

Related to this question, I guess, but I'm looking for "kk" not "ctrl ctrl"

I have Vim set up to use "jj" to exit insert mode with inoremap jj <esc>

I haven't been able to find a way to do something similar in tmux, aside from this which I'm having trouble understanding and am a bit nervous about.

This question is also related, but I think they're talking about having a sequence of keys after the prefix, while what I want is a way to avoid having to press any key combination (ctrl or alt or whatever).

(I originally asked this on StackOverflow but was told it would fit better over here; if I'm still in the wrong place, sorry - I'm very new to these communities)

New contributor
Roaming Raccoon is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
2
  • 1
    first of all: welcome here! I think you're in the right place, even if I'm not an expert on tmux keybindings myself Commented 2 days ago
  • Probably it could be done by a short program which create a new console and send to original console the key and "translate" keys to a prefix (and such program call tmux) Commented yesterday

1 Answer 1

4

AFAIK using character sequences as escape is not possible in tmux.

I am using the table / switch-client feature. This is extremely useful for expanding the available shortcut space but it does not (reasonably) achieve what you want.

If you wanted kk as an escape sequence then you would have to

  • make k the escape key
  • use the switch-client feature to change the table with the second k
  • map every other key in the prefix table to entering first k and then itself

Sounds like a nightmare to me.

The switch-client feature allows you to map the same key to several functions (in different "tables"), depending on what you pressed before (only the escape key or some key in addition to it).

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.