This post discusses how to set pane colours for active/inactive panes, and ensure the setting is applied to Vim panes. See this post for more ways to customise tmux.

Note: This post is for those who use light text on a *black* background. If you use black text on a white background, then you will need to change the colours accordingly. To set the background/foreground colours of your terminal, the appropriate colour pallete can be chosen in your terminal emulator/iTerm.

If for whatever reason changing the active/inactive pane colours does not work out for you, see the section Going back to see how to undo these changes.

Update: a good colour chart can be found on this page.

Active/inactive pane colours

The below block of code sets the colours of the active/inactive panes, and the borders of the panes. The ability to distinguish the active/inactive pane backgrounds is a feature of tmux 2.1. Add the following to your .tmux.conf:

#-------------------------------------------------------#
#Pane colours
#-------------------------------------------------------#
# set inactive/active window styles
set -g window-style 'fg=colour247,bg=colour236'
set -g window-active-style 'fg=colour250,bg=black'
 
#pane border
set -g pane-border-bg colour235
set -g pane-border-fg colour238
set -g pane-active-border-bg colour236
set -g pane-active-border-fg colour51
#-------------------------------------------------------#

The pictures below show how the inactive panes are slightly greyed, and that the border of the active panes is cyan.

vim pane is active

In the above figure, the Vim pane on the left is active.

bash pane is active

In the above figure, the bash pane in the top-right corner is active.

Going back (to defaults)

If you want to go back to the default colours, it is easy, just replace the block above with the following and reload your ~/.tmux.conf file.

#-------------------------------------------------------#
# Default inactive/active window styles
#-------------------------------------------------------#
set -g window-style 'fg=default,bg=default'
set -g window-active-style 'fg=default,bg=default'
#-------------------------------------------------------#

Vim colourscheme settings

In order for the inactive window style to be applied to Vim panes, it is necessary to check the line in your colourscheme.vim file that starts with hi Normal, e.g.

hi Normal           guifg=#e6e1de ctermfg=7 guibg=#2b2b2b ctermbg=235 gui=none

The problem with this line is the two terms guibg= and ctermbg=235. If these terms are deleted, as in:

hi Normal           guifg=#e6e1de ctermfg=7 gui=none

or

hi Normal           guifg=#e6e1de ctermfg=none gui=none

then the inactive style will be applied to Vim panes. Thanks to Nicholas Marriott for answering my question about this! (For some reason, I had difficulty replying to the Google Groups post, but another user later filled in the details).