Tmux – How to Send Key Bind to Program Running in Tmux

keyboard shortcutsrangertmux

Let's say I'm running ranger inside tmux session, but I want to send a keyboard shortcut to ranger (e.g. Ctrl+H) which is already used in tmux.

Is there a passthrough mode to send key binding to underlying program similar to vim's Ctrl+O in "insert mode"?

I know you can set a key bind to send a key bind, but that's not practical to map all other program key bind.

Best Answer

You can use send-keys:

C-b : send C-h

C-h is not a key used by tmux by default (precisely so you don't need to do this).

If you are running 3.1 or master you could try something like this to make a key which sends the next key:

bind -n C-o command-prompt -kp key 'send %%%'
Related Question