3

I would like to bind the tmux find-window prompt to pressing and releasing Shift twice.

I have already tried

bind-key -n S-S command-prompt "find-window -N '%%'"

This results in no error message, checked with :show-messages, but does not trigger the action when double-tapping Shift.

6

You can use under to configure Shift to emit e.g. Alt+Ctrl+Shift+F12 when tapped and released. Then you would declare that as a secondary tmux escape key, and assign a Key-binding to "Alt+Ctrl+Shift+F12" for command-prompt "find-window -N '%%'"

The exact sequence of commands:

At shell prompt:

$ xcape -e 'Shift_L=Alt_L|Control_R|Shift_L|F12'

At tmux prompt:

:set-option prefix2 "M-C-S-F12"
:bind M-C-S-F12 command-prompt "find-window -N '%%'"

Now double-tap Shift_L, and on the bottom left of your tmuxyou will see (find-window).

With Shift_R=Alt_L|Control_R|Shift_L|F11 you can use Shift_L for inner tmux, and Shift_R for outer tmux, if you nest them.

Note: I had previously posted this answer with F15, but that did not work as expected , because @Gilles says: F13 - F20 need to be declared in terminfo.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.