-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Intermittent copy/paste issues #151
Comments
Quick update:
As I mentioned in the original issue above, it seems to break when I copy a few hundred lines or more. So, maybe there's a bug in one of the components (tmux-yank, xclip, xsel, etc) when copying large amounts of data. I'll file a more coherent issue on the correct repo if I can nail down the root cause of the problem. |
A question for the contributors... Does anybody know if tmux-yank, xclip, and/or xsel do any logging when they encounter an error? If so, anyone know where they are? I'm thinking that an exception might be occurring when I copy a large amount of content. If logs exist, it might help me nail down which component is breaking. |
I'm having this issue on Ubuntu 22.04 (PopOS) but pasting content yanked with Copy dataaaaaaaaaaaaaaaaaaaa paste data with Ctrl + V in an external application or Ctrl + Shift +V in the terminal; at some point in time, this will workaaaaaaaaaaaaaaaaaaa copy more databbbbbbbbbbbbbbbbbbb paste dataaaaaaaaaaaaaaaaaaaa From here on out, data will keep getting appended to this buffer. If I run either @grese are you also using I'm thinking of opening a separate issue since we have slightly different scenarios. Also you could add your shell function to
Documented here https://tmux-plugins.github.io/tmux-yank/ |
did you manage to solve this @life5ign , I don't use tmux-yank but I'm having this issue with neovim+tmux+popos, this doesn't happen with same dotfiles in ubuntu |
I have the same problem when using tmux with kitty under hyprland, here is my configuration
|
I'm still having the issue, unfortunately. ooc, are you using kitty as your terminal emulator? @ch3n9w does the problem go away when you stop using kitty? I also am using kitty. |
@life5ign yes! I found the problem disappears when I switch to another terminal emulators like alacritty and foot. BTW, I noticed that the clipboard problem happened when I copy text from neovim using nvim-osc52 plugin, however, if I focus to another window and then focus back to kitty, the problem disappeared! Not sure if it has something to do with my desktop environment (hyprland). |
@ch3n9w ok, it goes away for me too when I use e.g. gnome terminal. So that's something... above my ability/time to debug the interaction between tmux yank and kitty right now, but at least there's a workaround. My DE is simply Gnome, so the base issue I think is with the plugin and the emulator, not the DE, most likely. |
I think we should open a separate issue e.g. "tmux-yank accumulates and appends copied content to the system clipboard when using the kitty terminal emulator in various desktop environments." The title of this issue is too generic imho. |
@life5ign I think the issue should be under kitty topic. kovidgoyal/kitty#6890 |
I've managed, at least for the time being, to fix this with the following suite of config options # I always had these
set -g set-clipboard off # fix race condition with terminal and tmux
bind -T copy-mode-vi y send-keys -X copy-pipe "xclip -i -selection clipboard > /dev/null 2>&1"
# I just added these from the tmux-yank docs
set -g @custom_copy_command "xclip -i -selection clipboard > /dev/null 2>&1"
set -g @override_copy_command "xclip -i -selection clipboard > /dev/null 2>&1" It also started off working for me but eventually ended up not working. I guess this might have something to do with tmux-yank somehow conflicting with whatever happens under the hood when I use vi mode to yank? There's no obvious logs anywhere so its hard to tell. I didn't have to restart tmux after adding those new lines, just sourced the config again. I probably don't even need the vi keybinds given the current behavior 🤷 Yeah, I guess a million years ago I needed those vi keybinds but I clearly don't anymore, so just adding the overrides for tmux-yank to use xclip seems to work. |
I've been encountering an intermittent issue. I'm not sure if its a tmux issue, a tmux-yank problem, an issue with one of the other plugins, or an xclip/xsel issue. My tmux config is shown below.
My copy/paste workflow is as follows... I select text in tmux using the mouse, and then press "y" to copy to my system clipboard. Then, I can paste into any terminal/tmux window using "ctrl+shift+c". It works for a while, but it will break after some time.
When it breaks, here's what I've observed... After copying a large amount of data (a few hundred lines or more), the copy/paste behavior in the terminal/xterm seems to break. After that, when I copy something new, the new content is written to the system clipboard (because I can paste into a text document outside of the terminal). However, when I try to paste into the terminal/tmux, the clipboard still contains the OLD clipboard contents (most of the large amount of content). No matter how many times I re-copy the new content, its still there. Just to reiterate... if I paste outside of the terminal/tmux, the content is correct.
The problem happens pretty consistently when I copy a relatively large amount of content (more than a few hundred lines). That's normally when this happens. Pasting into other programs outside of the terminal has the correct content. Just pasting into the terminal produces the incorrect contents (strange, isn't it?).
Closing/opening terminal windows and killing/restarting tmux sessions doesn't help. The only thing I've been able to do to get it working again is to restart the computer.
Here's a quick illustration of the issue
Step 1: Copy a few hundred lines of content:
Data copied:
Data pasted into terminal (correct):
Step 2: Copy something new.
Data Copied:
Data pasted into terminal (incorrect):
Data pasted outside terminal (correct):
The text was updated successfully, but these errors were encountered: