.tmux.conf文件中set -g,set -ga和set-option -g之间有什么区别?

hro*_*okr 20 configuration-files tmux

我是tmux的新手并试图理解它的配置.我已经开始查看一些预先存在的.tmux.conf文件以及我能找到的任何文档,但它仍然让我对这些标志感到疑惑.到目前为止我见过以下内容:

来自tmux上ArchWiki条目的一些示例

set -g prefix C-a  
set -ga terminal-overrides ",xterm-termite:Tc"
set-option -g xterm-keys on
Run Code Online (Sandbox Code Playgroud)

.tmux.conf文件中一行

set-window-option -g
Run Code Online (Sandbox Code Playgroud)

标志是什么意思,当一个标志一个标志优于另一个标志时,是否有任何特殊情况?

pdo*_*926 25

set是别的set-option.

set -g用于设置全局选项-ga并将值附加到现有设置.

来自Tmux的手册页:

使用-a,如果选项需要字符串或样式,则将值附加到现有设置.例如:

   set -g status-left "foo"
   set -ag status-left "bar"
Run Code Online (Sandbox Code Playgroud)

将导致'foobar'.和:

   set -g status-style "bg=red"
   set -ag status-style "fg=blue"
Run Code Online (Sandbox Code Playgroud)

将导致红色背景和蓝色前景.如果没有-a,结果将是默认背景和蓝色前景.

set-window-option(别名setw)用于配置窗口的选项(allow-rename,mode-keys,synchronize-panes,等等)和相同的标志的选项是可用的.

看到:

  • @rgin是的,tmux`CHANGES`文件中的[2008条目](https://github.com/tmux/tmux/blob/1a11c972aed11c1996d732f15ad16f02c668b5a0/CHANGES#L3018-L3019)将`setw`作为`set-的别名window-option`,[2010 条目](https://github.com/tmux/tmux/blob/1a11c972aed11c1996d732f15ad16f02c668b5a0/CHANGES#L1968-L1969) 将 `set-window-option` 记录为 `set-option` 的新别名-w` 和 [tmux 3.0 条目](https://github.com/tmux/tmux/blob/1a11c972aed11c1996d732f15ad16f02c668b5a0/CHANGES#L759-L760) 宣布取消对 `set-window-option` 的文档化。 (4认同)
  • 嗯,tmux 3.0a 手册页没有解释 `setw` 和 `set-window-option`。另外,“set-option”还有一个“-w”用于窗口选项。 (3认同)