gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-03 11:54:52 26 4
gpt4 key购买 nike

我是 tmux 的新手并试图了解它的配置。我已经开始查看一些预先存在的 .tmux.conf 文件和我能找到的任何文档,但它仍然让我想知道这些标志。到目前为止,我已经看到了以下内容:

来自 ArchWiki entry on tmux 的几个例子

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

这些标志是什么意思,当一个标志一个标志比另一个标志更可取时,是否有任何特殊情况?

最佳答案

setset-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 )用于配置窗口选项( allow-renamemode-keyssynchronize-panes 等)并且可以使用相同的标志选项。

看:
  • https://linux.die.net/man/1/tmux
  • https://superuser.com/questions/758843/difference-between-global-server-session-and-window-options
  • 关于configuration-files - .tmux.conf 文件中的 set -g、set -ga 和 set-option -g 之间有什么区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45017773/

    26 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com