Copy and Paste in tmux

tmuxclipboard

tmux is wonderful and I can't live without it. But copying content from with tmux into system clipboard was always fiddly. This setup from thoughtbot use to work for me for a long time. Until it stopped working. I have done the researching work so you don't have to. Here is the solution:

bind-key -Tcopy-mode-vi 'v' send -X begin-selection
bind-key -Tcopy-mode-vi 'y' send -X copy-pipe-and-cancel pbcopy

Found the solution from this issue of tmux. Nothing beats the feeling of watching a software evolve like that after more than a decade.