what does the 'set -g' command do in tmux?

I see references to set -g <command> in tmux, for example

set -g status-right ' #[bg=colour33] Branch #[(git branch)] '

I have googled and looked in man tmux and also info tmux but cant find any info.

what does set -g do?
does it set a variable in the same way that vim uses :set <variable> ?
If so what does the -g do?


What does the 'set -g' command do in tmux?

  • set is an alias for set-option.

  • -g is used to set the option for the global session or window.

Commands which set options are as follows:

set-option [-agoqsuw] [-t target-session | target-window] option value (alias: set)

Set a window option with -w (equivalent to the set-window-option command), a server option with -s, otherwise a session option.

If -g is specified, the global session or window option is set.

Source tmux — terminal multiplexer