by vbezhenar · 10y ago · 0 comments
In newer versions of tmux, you just add 'set -g mouse on' to your ~/.tmux.conf. I also have copy mode set to use vi keybindings, and I can yank to the system clipboard.
https://github.com/rhinoceraptor/dotfiles/blob/master/tmux/....
I like to have a single key binding to toggle mouse on/off, so I found a clever (although hacky) way reading someone's .tmux.conf, and have used it ever since:
# toggle mouse
bind m run "cut -c3- ~/.tmux.conf | sh -s toggle_mouse"
# toggle_mouse() {
# old=$(tmux show -g -w | grep mode-mouse | cut -d' ' -f2)
# new=""
#
# if [ "$old" = "on" ] ; then
# new="off"
# else
# new="on"
# fi
#
# tmux set -g mode-mouse $new \;\
# set -g mouse-resize-pane $new \;\
# set -g mouse-select-pane $new \;\
# set -g mouse-select-window $new \;\
# display "mouse: $new"
# }Before I upgraded to v2.1, both keybinding and its behaviour was different.
termcapinfo xterm ti@:te@
See:https://www.mattcutts.com/blog/screen-power-tips-screenrc/
It took me years to find this out!
Oh, and I think tmux' "mouse on" lets you wheel-scroll the buffer, although I haven't used it.