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


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 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM