tmux-yank icon indicating copy to clipboard operation
tmux-yank copied to clipboard

tmux yank no longer working

Open jamesla opened this issue 1 year ago • 14 comments

Have recently updated system and everything else clipboard is working fine however the tmux yank is no longer copying.

Not actually even sure how to troubleshoot as it just fails silently and I can't find an error message in logs etc.

What is the best way to troubleshoot tmux yank?

jamesla avatar Aug 07 '23 02:08 jamesla

What OS version are you on? And is tmux-yank updated? (prefix-u to update it if you are using TPM)

anakimluke avatar Aug 07 '23 23:08 anakimluke

I'm on nixos and I'm using the tmux-yank nix package (which follows the manual installation method).

Is there anyway to show what plugins are loaded when done manually?

jamesla avatar Aug 08 '23 06:08 jamesla

The same on me on WSL Ubuntu 22.04 Issue after update to VScode 1.82.0 May related with Disable bracketed paste mode

DANic-git avatar Sep 08 '23 15:09 DANic-git

The nix package seems to be either old or misconfigured. I tested on nixos with the packages tmux and tmuxPlugins.yank and couldn't get it to work. Using only the nix package tmux and installing tmux-yank following the manual installation instructions on this repo I get normal behavior.

@jamesla maybe move this issue to nixpkgs?

@DANic-git are you using nix as well?

anakimluke avatar Sep 14 '23 19:09 anakimluke

I use VScode integrated terminal with WSL Ubuntu issue related with https://github.com/microsoft/vscode/issues/192518

DANic-git avatar Sep 15 '23 07:09 DANic-git

The nix package seems to be either old or misconfigured. I tested on nixos with the packages tmux and tmuxPlugins.yank and couldn't get it to work. Using only the nix package tmux and installing tmux-yank following the manual installation instructions on this repo I get normal behavior.

@jamesla maybe move this issue to nixpkgs?

@DANic-git are you using nix as well?

I've just overridden that outdated nix package to use the latest version of tmux yank acfd36e4fcba99f8310a7dfb432111c242fe7392 which is the latest commit on master however still not working.

Is there any way from within tmux to see what version of yank is being installed?

jamesla avatar Sep 15 '23 07:09 jamesla

Is there any way from within tmux to see what version of yank is being installed?

Hmm I don't think so. Unless using tpm, installing a package simply means running a bash script.

Can you roll back to the last version you had it working? I don't know much about nix so I can't help here.

anakimluke avatar Sep 15 '23 21:09 anakimluke

Unfortunately I can't roll back so only option is to fix this.

are there any debug style commands that I can use to try and provoke the yank plugin into giving me an error message or something?

jamesla avatar Sep 17 '23 05:09 jamesla

In my case, yanking stopped working only over an SSH/Mosh session. Locally, it works.

Remote host

  • Both xsel and xclip installed.
  • ~/.tmux.conf relevant contents
set -as terminal-features ',*:clipboard'

[..]

set -g @plugin 'tmux-plugins/tmux-yank'
[..]
  • Additional Info
$ tmux -V
tmux 3.3a
$ tmux show -s set-clipboard
set-clipboard external
$ tmux show -s copy-command
copy-command ''
$ tmux info | grep 'Ms:'
 192: Ms: (string) \033]52;%p1%s;%p2%s\a

Anything else I could provide to aid in debugging?

lh0n avatar Oct 03 '23 19:10 lh0n

@lh0n It is expected for tmux-yank not to work if used inside an ssh session. By default the remote system doesn't have access to your local system's clipboard. Try starting tmux first, then connecting to the ssh session :)

anakimluke avatar Oct 03 '23 22:10 anakimluke

@anakimluke It works just fine! That's what this line is for in the config.

set -as terminal-features ',*:clipboard'

lh0n avatar Oct 04 '23 13:10 lh0n

@lh0n What I meant is that your problem is different than the one discussed in this issue. You can create a feature request if you want :) Though I think it'd be more productive for you to google ways of sharing the clipboard between the local host and the host connected via ssh. Probably using X forwarding should work for you, if you trust the remote machine(because of the security concerns that X forwarding can bring). There seems to be other alternatives too; here some results from a brief google search: wincent/clipper, haya14busa/vim-poweryank and fcpg/vim-osc52. I haven't used those tools so I can't help with the specifics ;)

anakimluke avatar Oct 04 '23 18:10 anakimluke

I've had a similar issue where after updating the system the tmux-yank stopped working for me. I finally got so annoyed that I decided to fix it and after some googling and trial and error I managed to fix it by adding these to my .tmux.conf

set -g set-clipboard on

set -g @override_copy_command 'xclip -i -selection clipboard'

set -g @yank_selection 'clipboard'

set -as terminal-features ',*:clipboard'

Not sure if all of them are necessary but I don't want to touch it anymore, it works now. Hope it helps someone.

jrusz avatar Nov 27 '23 13:11 jrusz

I have been having the same issue with Fedora 39 and Kali both running KDE. My terminal was konsole and tmux-yank to clipboard did not work. Moving to KITTY has resolved this with no change to the config. I have tested under wayland and.

trb143 avatar Jan 21 '24 08:01 trb143

I am also facing this issue recently in my Arch Linux. I use alacritty as my main terminal. I even tried with kitty as suggested by @trb143 but faced same issue. I was able to fix it temporary by applying fix provided by @jrusz .

T4puSD avatar May 20 '24 17:05 T4puSD