9

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?

1 Answer 1

11

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

2
  • 1
    Great answer, thanks! yes once you know set is an alias for set-option then it makes sense, i.e. There are options applied at a global level, which may or many not be inherited by the option state of the session and window. I wish I had more rep so I could upvote this answer! Jun 18, 2015 at 10:36
  • 1
    Yes, power must have been diverted from the shields just long enough to give me the rep gravity boost I needed to upvote! upvoted :) Jun 18, 2015 at 10:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.