您的位置:首页 > 其它

tmux/screen里面如何用鼠标滚轮来卷动窗口内容

2014-05-15 11:47 381 查看
tmux里面用鼠标滚轮来卷动窗口内容

在 tmux里面,因为每个窗口(tmux window)的历史内容已经被tmux接管了,所以原来console/terminal提供的Shift+PgUp/PgDn所显示的内容并不是当前窗口的历史内容,所以要用C-b [ 进入copy-mode,然后才能用PgUp/PgDn/光标/Ctrl-S等键在copy-mode中移动。

如果要启用鼠标滚轮来卷动窗口内容的话,可以按C-b :然后输入
setw mode-mouse on
这就可以了。如果要对所有窗口开启的话:
setw -g mode-mouse on
(这种情况下,Vi/Emacs等全屏程序并不受影响,还可以自己接管滚轮事件)

也可以加到~/.tmux.conf里面
set-window-option -g mode-mouse on
(setw其实是set-window-option的别名)

摘自: Scroll shell output with mouse in tmux - Super User

gnu screen里面呢
一种说法是在~/.screenrc里面添加
termcapinfo xterm* ti@:te@
xterm*用于匹配(glob match)你的当前term类型
Using the scrollwheel in GNU screen

另一种说法就比较复杂了,详见链接: How to use mousewheel in GNU Screen | Mikael Ståldal’s technical blog
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐