为了允许用鼠标滚动tmux窗格,我在~/.tmux.conf文件中放入了以下内容:
set -g mouse-mode on
然而,什么都没有改变。当我滚动时,它仍然在tmux之外滚动。为什么会这样?
为了允许用鼠标滚动tmux窗格,我在~/.tmux.conf文件中放入了以下内容:
set -g mouse-mode on
然而,什么都没有改变。当我滚动时,它仍然在tmux之外滚动。为什么会这样?
当前回答
试试这个。它在我的电脑上运行。
set -g mouse on
其他回答
试试这个。它在我的电脑上运行。
set -g mouse on
粘贴到~/.tmux.conf
set -g mouse on
在终端上运行
tmux source-file ~/.tmux.conf
给那些现在正失去理智的人一个快速提醒:
https://github.com/tmux/tmux/blob/310f0a960ca64fa3809545badc629c0c166c6cd2/CHANGES#L12
这就是
:setw -g mouse
因此该选项已在2.1版本中重命名(2015年10月18日)
更新日志如下:
Mouse-mode has been rewritten. There's now no longer options for:
- mouse-resize-pane
- mouse-select-pane
- mouse-select-window
- mode-mouse
Instead there is just one option: 'mouse' which turns on mouse support
这就是我现在在.tmux.conf文件中使用的
set -g mouse on
您仍然可以使用魔鬼逻辑设置选项取决于您当前的Tmux版本:请参阅我之前的回答。
但是自从Tmux v1.7以来,set-option添加了“-q”来屏蔽错误,不打印任何东西(参见changelog)。 我建议使用这个功能,它更易于阅读和扩展。
把这个添加到你的~/.tmux.conf:
# from v2.1
set -gq mouse on
# before v2.1
set -gq mode-mouse on
set -gq mouse-resize-pane on
set -gq mouse-select-pane on
set -gq mouse-select-window on
重新启动tmux或源文件新的.tmux.conf
旁注:如果人们更喜欢这个答案,我愿意删除我的旧答案