zed icon indicating copy to clipboard operation
zed copied to clipboard

Pasting from other applications doesn't work anymore since v0.185.X (X11)

Open DoPri opened this issue 7 months ago • 10 comments

Summary

Summary

Pasting from certain applications no longer works when only the text/plain MIME type is provided, and not, for example, text/plain;charset=utf-8.

Description

This bug appears to be introduced by #29387. Reverting to version v0.184.10 resolves it. Also, pasting from other applications (e.g. Chrome) which set text/plain;charset=utf-8 works fine. I also tested with v0.185.0-pre — same issue.

Steps to Reproduce:

  1. Copy text from an application that sets only the text/plain MIME type (e.g., Kate).
  2. Attempt to paste the copied text into Zed using CTRL+V or the right-click context menu.
  3. Observe that nothing is pasted.

Expected Behavior: The copied text should be inserted into the editor. Actual Behavior: Nothing happens.

There are no errors in zed.log.

Details

Working:

Click to Expand
~> xclip -selection clipboard -t TARGETS -o                                                                                                                                                                          21:28:00
TIMESTAMP
TARGETS
MULTIPLE
SAVE_TARGETS
UTF8_STRING
COMPOUND_TEXT
TEXT
STRING
text/plain;charset=utf-8
text/plain

Also working:

Click to Expand
~> xclip -selection clipboard -t TARGETS -o
TARGETS
SAVE_TARGETS
UTF8_STRING
text/plain;charset=utf-8
text/plain;charset=UTF-8

Not working:

Click to Expand
~> xclip -selection clipboard -t TARGETS -o
text/plain
UTF8_STRING
STRING
TEXT
TARGETS
MULTIPLE
TIMESTAMP
SAVE_TARGETS

Also not working:

Click to Expand
~> xclip -selection clipboard -t TARGETS -o
text/plain
UTF8_STRING
STRING
TEXT
text/html
TARGETS
MULTIPLE
TIMESTAMP
SAVE_TARGETS

Zed Version and System Specs

Zed: v0.185.15 (Zed) OS: Linux X11 ubuntu 24.04 Memory: 15 GiB Architecture: x86_64 GPU: AMD Radeon Graphics (RADV RENOIR) || radv || Mesa 24.2.8-1ubuntu1~24.04.1

DoPri avatar May 11 '25 19:05 DoPri

This is happening to me, too.

Zed Version and System Specs

Zed: v0.185.15 (Zed) OS: Linux X11 ubuntu 24.04 Memory: 31.1 GiB Architecture: x86_64 GPU: Intel(R) Xe Graphics (TGL GT2) || Intel open-source Mesa driver || Mesa 24.2.8-1ubuntu1~24.04.1

diegonix avatar May 12 '25 14:05 diegonix

Yes, i can confirm that. Paste from CopyQ app does not work on Zed 0.185.15 and works on Zed 0.184.10.

Zed Version and System Specs

Zed: v0.184.10 (Zed) OS: Linux X11 manjaro unknown Memory: 31.2 GiB Architecture: x86_64 GPU: Intel(R) UHD Graphics 620 (KBL GT2) || Intel open-source Mesa driver || Mesa 25.0.5-arch1.1

dpvpro avatar May 13 '25 15:05 dpvpro

On Linux Mint copying from xed is working, but it doesn't work if copy from the Telegram official app.

Zed Version and System Specs

Zed: v0.185.16 OS: Linux Mint 22.1 Memory: 16 GB Architecture: x86_64 GPU: Intel Corporation Raptor Lake-P [Iris Xe Graphics]

tiaga avatar May 13 '25 17:05 tiaga

Same here:

Zed: v0.185.15 (Zed) OS: Linux X11 arch unknown Memory: 15.3 GiB Architecture: x86_64 GPU: Intel(R) Iris(R) Xe Graphics (ADL GT2) || Intel open-source Mesa driver || Mesa 25.0.5-arch1.1

mardiros avatar May 14 '25 08:05 mardiros

I have the same problem:

Zed: v0.186.8 OS: Linux X11 ubuntu 24.04 Memory: 16 GiB Architecture: x86_64 GPU: Intel Alder Lake-P GT2 [Iris Xe Graphics]

mavallad avatar May 15 '25 10:05 mavallad

I have the same problem: Zed: 0.185, 0.186, 0.187 OS: Linux 6.14.6-1-MANJARO Memory: 16Gb Architecture: x86_64 GPU: GeForce GTX 1650 Mobile / Max-Q

JohnBat26 avatar May 15 '25 18:05 JohnBat26

Thanks all for reporting this regression. We're working on a fix.

notpeter avatar May 20 '25 14:05 notpeter

Apologies for the delay on this everyone. I'm reverting the refactor that caused this regression in #31033. We'll be releasing a stable and preview patch today containing the revert so things should go back to normal if you update tomorrow.

I attempted to reproduce the issue as described by @DoPri by building a simple application that just "pasted" a simple text string as "text/plain" on X11, and wasn't able to reproduce this issue. If any of you could provide me with some kernel/x11 logs to help point me towards the cause of the issue it would be much appreciated. I hope to setup a remote server that I can run older versions of X11 on (I tested on arch so relatively recent version of X11) to hopefully reproduce myself, so any information regarding kernel, os, and x11 versions where this issue is occuring would also be appreciated.

probably-neb avatar May 20 '25 16:05 probably-neb

If any of you could provide me with some kernel/x11 logs to help point me towards the cause of the issue it would be much appreciated. I hope to setup a remote server that I can run older versions of X11 on (I tested on arch so relatively recent version of X11) to hopefully reproduce myself, so any information regarding kernel, os, and x11 versions where this issue is occuring would also be appreciated.

I'm running the latest Kubuntu LTS version on my system. There’s nothing relevant in the kernel logs or the Xorg logs. If it helps, here is some information about my X server:

Click to Expand
~> xdpyinfo

name of display:    :0
version number:    11.0
vendor string:    The X.Org Foundation
vendor release number:    12101011
X.Org version: 21.1.11
maximum request size:  16777212 bytes
motion buffer size:  256
bitmap unit, bit order, padding:    32, LSBFirst, 32
image byte order:    LSBFirst
number of supported pixmap formats:    7
supported pixmap formats:
    depth 1, bits_per_pixel 1, scanline_pad 32
    depth 4, bits_per_pixel 8, scanline_pad 32
    depth 8, bits_per_pixel 8, scanline_pad 32
    depth 15, bits_per_pixel 16, scanline_pad 32
    depth 16, bits_per_pixel 16, scanline_pad 32
    depth 24, bits_per_pixel 32, scanline_pad 32
    depth 32, bits_per_pixel 32, scanline_pad 32
keycode range:    minimum 8, maximum 255
focus:  window 0x440000d, revert to PointerRoot
number of extensions:    28
    BIG-REQUESTS
    Composite
    DAMAGE
    DOUBLE-BUFFER
    DPMS
    DRI2
    DRI3
    GLX
    Generic Event Extension
    MIT-SCREEN-SAVER
    MIT-SHM
    Present
    RANDR
    RECORD
    RENDER
    SECURITY
    SHAPE
    SYNC
    X-Resource
    XC-MISC
    XFIXES
    XFree86-DGA
    XFree86-VidModeExtension
    XINERAMA
    XInputExtension
    XKEYBOARD
    XTEST
    XVideo
default screen number:    0
number of screens:    1

screen #0:
  dimensions:    1920x1080 pixels (506x285 millimeters)
  resolution:    96x96 dots per inch
  depths (7):    24, 1, 4, 8, 15, 16, 32
  root window id:    0x491
  depth of root window:    24 planes
  number of colormaps:    minimum 1, maximum 1
  default colormap:    0x20
  default number of colormap cells:    256
  preallocated pixels:    black 0, white 16777215
  options:    backing-store WHEN MAPPED, save-unders NO
  largest cursor:    256x256
  current input event mask:    0xfa8033
    KeyPressMask             KeyReleaseMask           EnterWindowMask          
    LeaveWindowMask          ExposureMask             StructureNotifyMask      
    SubstructureNotifyMask   SubstructureRedirectMask FocusChangeMask          
    PropertyChangeMask       ColormapChangeMask       
  number of visuals:    336
  default visual id:  0x21

by building a simple application that just "pasted" a simple text string as "text/plain" on X11

Feel free to share the code for that — I can try adapting it to see how I can reliably reproduce the issue on my setup.

DoPri avatar May 21 '25 09:05 DoPri

Finally reproduced! Found a bug in my app while creating a GitHub repo for it. I was sending the UTF8 text target before the "text/plain" :/, made them exclusive and now ctrl-v does nothing.

Here's the repo since I already made it https://github.com/probably-neb/x11-text-plain-copy. Very AI generated, except for the bug, that was just me

probably-neb avatar May 21 '25 18:05 probably-neb