Is it possible to style tmux on a per-session basis

colorssessiontmuxwindow

I set up 2 tmux sessions to work on different parts of a project (switching back and forth frequently). As their layout are pretty similar, I would like to set different status-bar color to help me quickly identify the current session.

After reading the manual, it seems that

set -t session_name status-bg blue

would be what I am looking for. But running that command changes both session status-bar color. Is it possible to achieve a per-session styling in tmux ?

I also tried naming the window and pass its name to -t but was no more successful.

Can't find that information. Also, I might not get tmux session use-case right.

Best Answer

You need to do the following in newer versions of tmux:

set -t session_name status-style bg=blue

This worked for me in tmux 3.0a. Also, if you subsequently want to change another attribute, say the color of the text in the status bar, you need to use the -a (append) option, as tmux will otherwise overwrite your previous setting (in this case the background color) with its default choice for the new setting (in this case, the text color). So it will look as follows:

set -a -t session_name status-style fg=green

You can find more information here http://man7.org/linux/man-pages/man1/tmux.1.html (search for setw and you'll get to the options section)

Related Question