Using Ctrl+B in less within tmux

Obviously you can't have two keys that do the same thing when both programs are listening. Tmux is going to get it first. You didn't specify which set of key bindings you don't want to re-learn, but you have to do something different because the same key is used for both apps.

If you only use it occationally in less you can just pass the real thing on by hit Ctrl+BB (that's Ctrl-B twice) in tmux to pass on a single Ctrl-B to the app in the current pane.

If you want to change the tmux binding to be something else (say like Ctrl+A like screen) you can add this to your `~/.tmux.conf file:

unbind C-b
set -g prefix C-a

If you want to use something else for less, the G key is usually bound to go to the top of the file already, so no changes necessary. If that change doesn't suit you, you can rebind keys using lesskey.


In tmux with the default configuration, pressing Ctrl+B twice sends one Ctrl+B to the application.


You can use the tmux command send-prefix. It will send your tmux key-binding prefix to the current window

For example, in .tmux.conf:

set-option -g prefix C-a
bind-key v send-prefix

Then, pressing Ctrl-a + v will send Ctrl-a to the terminal.

Tags:

Tmux