tmux-plugins / tmux-yank

Tmux plugin for copying to system clipboard. Works on OSX, Linux and Cygwin.
https://tmux-plugins.github.io/tmux-yank/
MIT License
2.72k stars 122 forks source link

unable to copy to system clipboard #180

Closed modernNeo closed 1 month ago

modernNeo commented 3 months ago

I think I have followed the instructions as they are set

I have ~/.tmux.conf

setw -g mode-keys vi
set-option -g status-position top
set -g set-clipboard on

# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-yank'

# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'

I installed xsel

 $  sudo apt-get install xsel 
[sudo] password for jace: 
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
xsel is already the newest version (1.2.0+git9bfc13d.20180109-4).

but when I am in tmux and I do Ctrl+B, [ and then hit [Space], make my selection and then do y, I don't think the selection was copied to the system clipboard, just the tmux-yank clipboard.

If I do Ctrl+V, I see something else get pasted. I can only what I selected above get pasted if I do Ctrl+B, ] in tmux.

What am I doing wrong?

I am on tmux 3.3a on a PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"

returnDanilo commented 3 months ago

I could not reproduce this on debian 12. Are you sure you pressed <prefix>I(that's a capital I) to make tpm install the plugins? Does <prefix>y in normal mode(not in copy mode, that is, after you pressed <prefix>[) show a message saying 'Line copied to clipboard!'?

aemirbosnak commented 3 months ago

I am having the exact same issue on Ubuntu 22.04 with xorg and tmux version 3.2a

I have done both <prefix>I and <prefix>U to install and update tmux-yank. Also installed xsel version 1.2.0.

I see Line copied to clipboard output on tmux status bar when I do <prefix>y but cant paste anything back from system clipboard (e.g. into the web browser)

returnDanilo commented 3 months ago

See if adding set -g @override_copy_command 'xsel -b' to the top of your tmux config file fixes it. Make sure you reboot.

If it does work, it might be because you have the wl-copy command available on your system and you are not currently running wayland. This happens because currently this plugin is configured to pick the first available command from a list; it doesn't check whether you are running wayland or X. It's something that could be improved on, for sure.

aemirbosnak commented 3 months ago

Yeah, that solved it thanks.

modernNeo commented 1 month ago

@returnDanilo finally got around to trying your solution and yea, it works on my system too. thanks so much 🙏🏿