Change background color of active or inactive pane in Tmux

It seems that tmux-2.1 (released 18 October 2015) now allows the colours of individual panes to be specified. From the changelog: * ‘select-pane’ now understands ‘-P’ to set window/pane background colours. e.g. [from the manual] to change pane 1’s foreground (text) to blue and background to red use: select-pane -t:.1 -P ‘fg=blue,bg=red’ To mimic iTerm … Read more

How do I jump to double-digit window number in tmux?

There are two straightforward options (let C-b represent the prefix key): Bring up a prompt in which to enter a specific window index with C-b ‘ (this is a default key binding). Press enter after inputting the desired index. Interactively select the window you want from a list with C-b w (also a default key … Read more

TMUX using HJKL to navigate panes

You can do this as follows: bind h select-pane -L bind j select-pane -D bind k select-pane -U bind l select-pane -R Note that mode-keys refers to using vi-like navigation within a buffer and status-keys refers to using vi-like editing within the status bar, but neither refers to switching between panes.

tmux send-keys syntax

The key names used by send-keys are the same ones that bind-key uses. From the Key Bindings section of the tmux manpage: When specifying keys, most represent themselves (for example ‘A’ to ‘Z’). Ctrl keys may be prefixed with ‘C-’ or ‘^’, and Alt (meta) with ‘M-’. In addition, the following special key names are … Read more

How to automatically rename tmux windows to the current directory

With tmux 2.3+, the b: format modifier shows the “basename” (or “tail”) of a path. set-option -g status-interval 5 set-option -g automatic-rename on set-option -g automatic-rename-format ‘#{b:pane_current_path}’ The FORMATS section of man tmux describes other modifiers, such as #{d:} and even #{s/foo/bar/:}. With tmux 2.2 or older, the basename shell command can be used instead. … Read more

Split pane switching in tmux: switch once per command

That happens because the default bindings for the arrow keys are setup with bind-key -r, specifying that they may be repeated. There are two ways that you can disable this. First, you can use set-option repeat-time 0 to disable repeating entirely. This will affect all bindings. I find that to be very annoying when resizing … Read more

How can you tell which pane in Tmux is focused?

Here are the relevant settings: pane-active-border-style fg=colour,bg=colour Set the pane border colour for the currently active pane. So, try adding something like this to your ~/.tmux.conf: set-option -g pane-active-border-style fg=blue That will set a blue border around the active pane. The pane-active-border-style bg=colour option can be used for a more visible solution, as well.