Skip to content

Instantly share code, notes, and snippets.

@avielsh
Last active February 6, 2019 18:42
Show Gist options
  • Save avielsh/3774fce76eaa0066025d8dc4c6e42c08 to your computer and use it in GitHub Desktop.
Save avielsh/3774fce76eaa0066025d8dc4c6e42c08 to your computer and use it in GitHub Desktop.
A simple hack to toggle mouse on/off for easier clipboard functionality #tmux

Tmux bind m to toggle mouse on/off

Run this on terminal to add to your .tmux.conf:

cat - <<-EOF
#bind m to Enable/Disable mouse (change to whatever you fancy)
bind m if-shell 'tmux show-options -vg mouse | grep on' \
"set -g mouse off \; display \"Mouse is off\"" \
"display \"Mouse is on\" \; set -g mouse on"
EOF >> ~/.tmux.conf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment