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