1

I have this tmux config:

bind | split-window -h
bind - split-window -v
unbind '"'
unbind %
bind-key s set-window-option synchronize-panes\; display-message "Paneles sincronizados: #{?pane_synchronized,on,off}"
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
bind r source-file ~/.tmux.conf
set -g mouse on
set -g default-terminal "screen-256color"
#set -g status-bg black
#set -g status-fg green
set-option -g allow-rename off
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
#set -g @plugin "arcticicestudio/nord-tmux"
set -g @plugin 'tmux-plugins/tmux-yank'
run '~/.tmux/plugins/tpm/tpm'
new-session

I have GNOME 41 with Fedora 35 workstation and Wayland enabled by default.

I've set up wl-clipboard, but It does not work with GPaste for example. The content selected by the mouse does not copy at any moment. Just only works if I copy/paste in the same terminal running tmux (likes a buffer).

In X.org this works with xclip...

Any ideas?

Thanks.

2 Answers 2

2

I followed this tutorial https://www.rockyourcode.com/copy-and-paste-in-tmux/

They introduce a configuration of clipboard with tmux without plugin. It works for me ClipboardIndicator and Wayland.

It is basically this config:

set-option -s set-clipboard off
bind P paste-buffer
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi V send-keys -X rectangle-toggle
unbind -T copy-mode-vi Enter
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'wl-copy'
bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel 'wl-copy'
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel 'wl-copy'

1

I solved this by providing copy-command as wl-copy on wayland .Tmux 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'
bind P paste-buffer
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi V send-keys -X rectangle-toggle
unbind -T copy-mode-vi Enter
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'wl-copy'
bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel 'wl-copy'
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel 'wl-copy'

source: https://www.guyrutenberg.com/2021/07/02/tmux-wayland-clipboard-integration/

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .