Copy and paste from tmux to OSX clipboard
- tmux kill-session (important: tmux must be restarted)
- brew install reattach-to-user-namespace
- Edit ~/.tmux.conf
# Important! For bash shell : use "-l zsh" for z shell set -g default-command "reattach-to-user-namespace -l bash" bind-key y run-shell "tmux save-buffer - | reattach-to-user-namespace pbcopy"
Then.
- tmux
- Open a file in a tmux window e.g.
less /var/log/apache/error.log
- Hit '{prefix} ['
- Hit 'spacebar'
- Select text block with arrow keys or vim/emacs movement bindings
- Hit 'Enter'
- Hit '{tmux-prefix} y'
- Check your OSX clipboard the paste should be there.
Alternate method
One work around is to open the file you want to copy using MacVim from your vim console session via :!mvim %
. From MacVim you get a nice copy to clipboard experience.
- Pushed on 06/05/2013 by Christian