如何抑制"确认'设置'?(y/n)" "TMUX 会议"设置 -g 鼠标打开"的 promtp ?



我会在不提示的情况下使这两个别名工作:

alias txmon="tmux conf 'set -g mouse on'  &&  tmux conf 'set -g mouse-utf8 on'"
alias txmoff="tmux conf 'set -g mouse off'  &&  tmux conf 'set -g mouse-utf8 off'"

但是当在 TMUX 会话中运行时,左下角会以棕色字体生成此提示:

Confirm 'set'? (y/n)

我在man tmux和World Wlid Web上都找不到有关此事的任何内容;)

conf 匹配命令confirm-before这就是它的作用 - 它要求确认。

如果您不希望它询问,请不要使用该命令:

alias txmon="tmux set -g mouse on ; set -g mouse-utf8 on"

请注意,mouse-utf8几年前已从 tmux 中删除,因此您应该检查您仍然需要它。

此外,如果要切换该选项,可以省略打开或关闭:tmux set -g mouse

最新更新