Updated tmux.conf for version 2.9

After upgrading to tmux 2.9 this week our standard .tmux.conf produced the error invalid option: window-status-current-bg.

Our updated version is using “window-status-current-style” instead and looks as follows:

# Change the default $TERM (and alias tmux='tmux -2')
set -g default-terminal "screen-256color"

# No bells at all
set -g bell-action none

# Start numbering at 1
set -g base-index 1

# Allows for faster key repetition
set -s escape-time 0

# Keep windows around after they exit
set -g remain-on-exit off

# Change the prefix key to C-a
set -g prefix C-a
unbind C-b
bind C-a send-prefix

# Allows us to use C-a a <command> to send commands to a TMUX session inside
# another TMUX session
bind-key a send-prefix

# Rather than constraining window size to the maximum size of any client
# connected to the *session*, constrain window size to the maximum size of any
# client connected to *that window*. Much more reasonable.
setw -g aggressive-resize on

# Turn the mouse on, but without copy mode dragging
set -g mouse on
unbind -n MouseDrag1Pane
unbind -Tcopy-mode MouseDrag1Pane

# A key to toggle between smallest and largest sizes if a window is visible in
# multiple places
bind F set -w window-size

# A key to reload configuration file
bind r source ~/.tmux.conf

# Keys to toggle monitoring activity in a window and the synchronize-panes option
bind m set monitor-activity
bind y set synchronize-panes\; display 'synchronize-panes #{?synchronize-panes,on,off}'

# Shift arrow to switch windows
bind -n S-Left  previous-window
bind -n S-Right next-window

# Use Alt-arrow keys without prefix key to switch panes
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D

# Status line colours
set -g status-left ""
set -g status-style "bg=colour249"
set -ag status-style "fg=black"
set -g window-status-current-style "bg=green"
set -ag window-status-current-style "fg=black"

# Status items right side
set -g status-interval 15
set -g status-right '#[fg=yellow]#(cut -d " " -f 1 /proc/loadavg)#[default] #[fg=black]%H:%M#[default]'

Changing the default terminal (line 2) can sometimes cause issues with warnings like terminal capability "cm" required. In that case exporting a TERM of “screen” or “xterm” will usually work around the issue. If the system supports it installing “ncurses-term” could increase the terminal capabilities.

Takala Consulting
Excellence begins here