logo

tested on openbsd 6.3

use x11 clipboard with xclip(1)

use x11 clipboard to copy paste text and images between x11 programs.

install xclip(1):

# pkg_add xclip
...
xclip-0.13p0: ok
#

edit ~/.tmux.conf:

...
bind -T copy-mode-vi 'y' send -X copy-pipe-and-cancel \
  'xclip -i -selection clipboard'

bind -T copy-mode-vi MouseDragEnd1Pane send -X copy-pipe-and-cancel \
  'xclip -i -selection clipboard'

bind -n MouseDown2Pane run \
  'tmux set-buffer "$(xclip -o -selection clipboard)";tmux paste-buffer'
...

edit ~/.exrc:

...
map gp :r!xclip -o -s clipboard^M
...

where ^M is ctrl+v then enter.