zed icon indicating copy to clipboard operation
zed copied to clipboard

Linux delete and backspace keys copy characters to Primary clipboard

Open jdoss opened this issue 1 year ago • 4 comments

Check for existing issues

  • [X] Completed

Describe the bug / provide steps to reproduce it

When running the nightly or normal build on Fedora 40 with X11 and when I use delete or backspace to remove characters Zed copies them to the clipboard. I use https://github.com/oae/gnome-shell-pano as my clipboard manager and I use Gpaste to sync my clipboard to the primary selection.

Environment

Zed: v0.142.0 (Zed Nightly)
OS: Linux X11 fedora 40
Memory: 251.5 GiB
Architecture: x86_64

and

Zed: v0.143.6 (Zed)
OS: Linux X11 fedora 40
Memory: 251.5 GiB
Architecture: x86_64

If applicable, add mockups / screenshots to help explain present your vision of the feature

Here's a screen cap of the bug:

Screencast_07_12_2024_02:38:16_PM.webm

If applicable, attach your Zed.log file to this issue.

Zed.log

jdoss avatar Jul 12 '24 19:07 jdoss

Ubuntu 23.10, Mate 1.26.2, everything stock. Can't reproduce this bug.

culebron avatar Jul 13 '24 06:07 culebron

@culebron Are you sure you are looking at the Primary clipboard? I just turned off the sync from Gpaste and Pano no longer shows the individual characters since it is not syncing things between the clipboard buffers.

I believe this is a bug that impacts the Primary clipboard.

Screencast_07_13_2024_10:58:08_AM.webm

jdoss avatar Jul 13 '24 16:07 jdoss

@jdoss oh, I see, this has to do with this particular clipboard. Nevermind, I don't use it.

culebron avatar Jul 13 '24 16:07 culebron

I thought this might intend behaviour, editor.rs.

CharlesChen0823 avatar Jul 14 '24 02:07 CharlesChen0823

Still able to reproduce this in 0.172.10 (b487d48b65a41ef9c7df4892f8f3212530646dc6). I use this buffer all the time, and to have a simple backspace trash it is pretty frustrating!

andygeorge avatar Feb 10 '25 18:02 andygeorge

I use Gpaste to sync my clipboard to the primary selection.

@jdoss To clarify, this behavior means that when you make a selection it's effectively the same as a select + copy? (clipboard automatically selection) How do you enable this mode? (so I can try and reproduce)

@andygeorge Do you also use this mode? If you disable this mode, does the issue still happen or does it only occur because Zed is updating the selection when it deletes a single character?

notpeter avatar Feb 10 '25 18:02 notpeter

I use Gpaste to sync my clipboard to the primary selection.

@jdoss To clarify, this behavior means that when you make a selection it's effectively the same as a select + copy? (clipboard automatically selection) How do you enable this mode? (so I can try and reproduce)

Correct. If you highlight text it will sync it to the copy (ctrl+c) buffer. A few clipboard managers have a feature that will sync the two buffers so you have the same text in the primary (highlight to copy, middle click to paste) and the ctrl+c / ctrl+v buffer. Here's gpaste's preference panel for syncing the two buffers. If you install gpaste you should be able to sync the two buffers using this setting.

Image

To be clear, this isn't a bug with using the clipboard sync. Even without syncing the clipboards you get single characters on backspace in the primary clipboard buffer on each backspace press.

jdoss avatar Feb 10 '25 18:02 jdoss

I am on Linux Mint, using Cinnamon, and don't use GPaste. The "backspace adds the deleted character to the middle-click buffer" is what I am experiencing.

andygeorge avatar Feb 10 '25 18:02 andygeorge

I believe this has been fixed. If you're still seeing this please comment with details and I'm happy to reopen. Thanks all!

notpeter avatar Jul 02 '25 19:07 notpeter