tmux 3.2 and above provides the copy-command
option to set a command to pipe text to copy. You will also need wl-copy
command from the wl-clipboard
package. Add the following line to your ~/.tmux.conf
:
set -s copy-command 'wl-copy'
As of writing this post, tmux-3.2 is only available in experimental, so you’ll need to install it from there:
$ sudo apt install -t experimental tmux
I’ve been using tmux-yank plugin, which enabled using wl-copy way before 3.2:
https://tmux-plugins.github.io/tmux-yank/
I came across tmux-yank as well. I liked that in tmux 3.2 you no longer need a plugin or a multitude of config options. Just one line.
Thanks for this man, saved me a lot of headaches!