Config right click to paste from system paste board in tmux on MacOS

Pre

if you use powerline on Windows, then you may be familiar with the “right click to paste from system board” feature.

Issue

on Unix-like system, I’d rather tmux in my workflow in which I found right click doesn’t behave like what it does on Windows.

Slolution

Luckily, we could config it.

Steps

1
2
3
# ~/.tmux.conf
# mouse binding
bind-key -T root MouseDown3Pane run-shell 'pbpaste | tmux load-buffer - \; paste-buffer -p'

-T indicates that we only change the keybinding under the root Key Table(you can check it by prefix+:customize mode)
no need to use the following repository, but found useful tmux config for pasting from system pasteboard here
ref: tmux-MacOSX-pasteboard