When xclip is writing to the clipboard, I redirect its stdout like so:
bind-key C-y run "tmux save-buffer - | xclip -i -selection clipboard > 
/dev/null"

(for reference I use the following command to paste inside tmux from 
clipboard: bind-key C-p run "tmux set-buffer \"$(xclip -o -selection 
clipboard)\"; tmux paste-buffer")

Also, make sure that you are accessing the same X display from different 
shells. After ssh logoff/logon, the DISPLAY might change. tmux picks this 
up correctly but already running shells won't.

HTH

On Tuesday, July 28, 2020 at 10:00:05 AM UTC-7, Kaushal Modi wrote:

> Hello,
>
> I have been having this in my tmux config for many years and it worked 
> fine, until recently (past few months).
>
> =====
> set -g set-clipboard off # default is on
>
> # Copy tmux buffer to primary and clipboard selections
> # run -b runs a shell command in background
> # http://grota.github.io/blog/2012/05/08/tmux-clipboard-integration/
> bind C-w run -b "tmux show-buffer | xclip -i -sel pri && tmux show-buffer 
> | xclip -i -sel cli"
>
> # Paste into tmux; also replace LF characters with
> # space as separator characters (-s) when pasting.
> # Yank from primary
> bind C-y run -b "xclip -o -sel pri | tmux load-buffer - && tmux 
> paste-buffer -s ' '"
> =====
>
> I just realized that the xclip processes created using these bindings 
> never get killed. Once a certain number of xclip processes are running in 
> parallel, copy/pasting in tmux using the above bindings stops working.
>
> Has there been a change in tmux 3+ that could affect this? I don't recall 
> having to kill stray xclip processes in the last tmux 2.x version.
>
> --
> Kaushal Modi
>

-- 
You received this message because you are subscribed to the Google Groups 
"tmux-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/tmux-users/b6addf5a-78b0-4778-99d5-4e3b10fea239o%40googlegroups.com.

Reply via email to