Skip to content

Instantly share code, notes, and snippets.

@michelbl
Created May 19, 2020 12:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save michelbl/e5d1caa32fc12bb1b961b924b84df538 to your computer and use it in GitHub Desktop.
Save michelbl/e5d1caa32fc12bb1b961b924b84df538 to your computer and use it in GitHub Desktop.
Configuration to use mouse and copy/paste with tmux
# Beforehand, to make it work with SSH you'll have to:
# * install xsel and xauth on target host
# * set X11Forwarding=yes in /etc/ssh/sshd_config
# * connect with option "-X"
# * on Mac, install XQuartz
#
# Test with "echo $DISPLAY", that variable should be set on the server
# tmux version 1.6
set-window-option -g mode-mouse on
set-option -g mouse-resize-pane on
set-option -g mouse-select-pane on
set-option -g mouse-select-window on
bind C-c run "tmux save-buffer - | xsel -ib"
bind C-v run "xsel -ob | tmux load-buffer - ; tmux paste-buffer"
# tmux version 2.x
set -g mouse on
bind C-c run "tmux save-buffer - | xsel -ib"
bind C-v run "xsel -ob | tmux load-buffer - ; tmux paste-buffer"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment