.tmux.conf 文件中的 set -g、set -ga 和 set-option -g 之间有什么区别?
What are the differences between set -g, set -ga and set-option -g in a .tmux.conf file?
我是 tmux 的新手,正在尝试了解它的配置。我已经开始查看一些预先存在的 .tmux.conf 文件和我能找到的任何文档,但它仍然让我对这些标志感到疑惑。到目前为止,我已经看到了以下内容:
中的几个示例
set -g prefix C-a
set -ga terminal-overrides ",xterm-termite:Tc"
set-option -g xterm-keys on
还有来自 .tmux.conf file
的一行
set-window-option -g
这些标志是什么意思,是否存在任何特定情况下一个标志比另一个标志更可取?
set
是 set-option
的别名。
set -g
用于设置全局选项,-ga
将值附加到现有设置。
来自 Tmux 的手册页:
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
(别名setw
)用于配置window选项(allow-rename
、mode-keys
、synchronize-panes
等)并且可以使用相同的标志选项。
参见:
我是 tmux 的新手,正在尝试了解它的配置。我已经开始查看一些预先存在的 .tmux.conf 文件和我能找到的任何文档,但它仍然让我对这些标志感到疑惑。到目前为止,我已经看到了以下内容:
中的几个示例set -g prefix C-a
set -ga terminal-overrides ",xterm-termite:Tc"
set-option -g xterm-keys on
还有来自 .tmux.conf file
的一行set-window-option -g
这些标志是什么意思,是否存在任何特定情况下一个标志比另一个标志更可取?
set
是 set-option
的别名。
set -g
用于设置全局选项,-ga
将值附加到现有设置。
来自 Tmux 的手册页:
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
(别名setw
)用于配置window选项(allow-rename
、mode-keys
、synchronize-panes
等)并且可以使用相同的标志选项。
参见: