Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the differences between set -g, set -ga and set-option -g in a .tmux.conf file?

I'm new to tmux and trying to understand it's configuration. I've started with looking at some pre-existing .tmux.conf files and whatever documentation I can find but it still leaves me wondering about the flags. I've seen the following so far:

A few examples from the ArchWiki entry on tmux

set -g prefix C-a   set -ga terminal-overrides ",xterm-termite:Tc" set-option -g xterm-keys on 

And one line from a .tmux.conf file

set-window-option -g 

What do the flags mean and are there any particular cases when one flag one flag is preferable over another?

like image 403
hrokr Avatar asked Jul 10 '17 16:07

hrokr


People also ask

What is tmux conf?

Tmux is an open-source terminal multiplexer application for efficiently managing multiple terminal windows. People who have previously used the Terminator application are primarily familiar with the notion of tab management in Linux Terminal. With Tmux, we can split the terminal into a number of panes.

What is SETW in tmux?

"set" sets an option which will remain unchanged when "set -g" is run. "setw" has different options from "set" and "setw -g" acts similarly to "set -g" in that setting that global will not change the value when checked with "show-window-option".

Where can you find examples for custom tmux conf config files?

The config file is located in /usr/share/tmux , not in /usr/share/doc/tmux .


1 Answers

set is the alias of set-option.

set -g is used to set global options and -ga appends values to existing settings.

From Tmux's man page:

With -a, and if the option expects a string or a style, value is appended to the existing setting. For example:

   set -g status-left "foo"    set -ag status-left "bar" 

Will result in ‘foobar’. And:

   set -g status-style "bg=red"    set -ag status-style "fg=blue" 

Will result in a red background and blue foreground. Without -a, the result would be the default background and a blue foreground.

set-window-option (alias setw) is used to configure window options (allow-rename, mode-keys, synchronize-panes, etc.) and the same flag options are available.

See:

  • https://linux.die.net/man/1/tmux
  • https://superuser.com/questions/758843/difference-between-global-server-session-and-window-options
like image 171
pdoherty926 Avatar answered Sep 30 '22 02:09

pdoherty926