I am trying to figure out a decent way to copy what I have in a tmux buffer into my clipboard. I have tried a couple of different things like
bind-key p select-pane -t 2 \; split-window 'xsel -i -b' \; paste-buffer
which gets me fairly close, all I have to do is hit control-d after I do prefix-p.
I tried fixing that by doing
bind-key p select-pane -t 2 \; split-window 'xsel -i -b << HERE\; tmux paste-buffer\; echo HERE'
But that just doesn't work. In fact if I pair this down to just
bind-key p select-pane -t 2 \; split-window 'xsel -i -b << HERE'
it doesn't do anything so I am assuming that split-window doesn't like << in a shell command.
You can skip the
select-pane -t 2 if you want, it inst really important. I just use a specific layout and pane 2 is the one i prefer to split when I doing something else so that goes into my bindings involving splits by default.