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