Evert Pot wrote this great article on Making the clipboard work between iTerm2, tmux, vim and OS X. The only thing missing from this post is how you can use the mouse from within tmux to copy to OS X's clipboard.

There are two ways of doing this:

  • Bad old way: Hold down alt (⌥) and select with the mouse like you would in a normal iTerm session. Bad because this doesn't play nicely with vertical windows - you end up copying text from two windows which is probably never what you need
  • Better way: Select with the mouse, and before letting go, press y to copy - game changer. This way respects tmux windows. This little gem was in Evert's Disqus comments (thank you Manoj Mahalingam)

tmux, you're the best