Skip to content

[Bug]: On Linux/Wayland, Ctrl+V keeps pasting T3's last Copy-button copy and ignores newer copies from other apps #31189

Open

Description

@kevinhsykes

Bug

On Linux with native Wayland, after you use any T3 Code Copy action, Ctrl+V in T3 keeps pasting that same copied text. A later copy from another app is ignored, and this lasts until T3 restarts.

Copies made with Ctrl+C inside T3 are not affected. Only copies made through T3's Copy actions trigger it.

Cause

T3's Copy actions write the clipboard from the main process: ElectronShell.copyText calls electron.clipboard.writeText (apps/desktop/dist-electron/main.cjs). On native Wayland, if an Electron app writes the clipboard this way, the app's later clipboard reads return its own write and not the system clipboard. This is upstream Electron bug electron/electron#54645, which others have reproduced on Electron 43, 44.5.1 and 45.

Reproduction

Environment: T3 Code 0.1.8-nightly.20261104.4179, Electron 44.10.1, Chromium 152.0.7977.169, Hyprland 0.55.2, native Wayland. I ran T3's own Electron binary with a test app and a focused window:

case system clipboard (wl-paste) Ctrl+V into the app
the app has not written the clipboard B B ✅
the app wrote A with clipboard.writeText in the main process B A ❌
the user pressed Ctrl+C inside the app on A, then another app copied B B B ✅

The bad case in T3:

  1. Click a Copy action in T3.
  2. Copy different text in another app, or with wl-copy.
  3. Press Ctrl+V in the T3 composer. The text from step 1 appears.

This also breaks dictation and other tools that paste text with a synthetic Ctrl+V.

Possible fix (not tested in T3)

Write the clipboard in the renderer during the click, for example with navigator.clipboard.writeText from the click handler, the same way an in-page Ctrl+C writes it. Our test showed that the in-page copy does not cause the problem. Another option is to call electron.clipboard.writeText from main only when the app is not running on native Wayland.

Activity

  1. juliusmarminge commented on Nov 4, 2026

    @juliusmarminge
    Member

    Thanks for the detailed write-up and the link to electron/electron#54645.

    We couldn't reproduce this in T3 Code itself on main (a21d788, Electron 44.10.1). T3 ran as a native Wayland client under a wlroots compositor (sway 1.9) with real pointer and keyboard input:

    T3 copy action then Ctrl+V in T3 pasted
    Settings › About › Copy version (renderer navigator.clipboard) wl-copy other text the newer text ✅
    Right-click a link › Copy Link (main-process clipboard.writeText, the ElectronShell.copyText path) wl-copy other text the newer text ✅
    Both of the above copy in another app's window, click back into T3 the newer text ✅

    In a small test app on the same Electron binary, we only got the stuck state when the main process wrote the clipboard before the app had received any click or key press (this matches the repro in #54645). Chromium sends wl_data_device.set_selection only when it has an input serial. Once the window has had a click or key press, renderer and main-process writes take the same path and both reached the compositor. We also checked Hyprland's set_selection handler: it doesn't validate the serial, so a click on a Copy button should be enough there too.

    Could you help us close the gap?

    1. Which T3 Copy action triggers it for you (for example, the Copy button on a message, a code block, or the Copy Link context-menu item)? Does it still happen if you click inside the T3 window first and then use that Copy action?
    2. A Wayland protocol log from T3 itself: start T3 with WAYLAND_DEBUG=client set, do steps 1–3 with harmless text, and attach the lines around the Copy click that mention set_selection, wl_data_source or cancelled.
    3. How you launch T3 (--ozone-platform=wayland, ELECTRON_OZONE_PLATFORM_HINT, or other flags), and whether you use an input method (fcitx5, ibus), a pen tablet, or a touchscreen.
  2. 0xKa commented on Nov 10, 2026

    @0xKa
    Contributor

    Can't reproduce this on KDE Plasma 6.8.2 Wayland (T3 0.1.9-nightly.20261110.4452, Electron 44.10.1, native Wayland, no launch flags). After both a message Copy button and the native right-click › Copy Link (the main-process ElectronShell.copyText path), a later wl-copy was what Ctrl+V pasted in T3. That matches Julius's sway result.

  3. juliusmarminge commented on Nov 12, 2026

    @juliusmarminge
    Member

    @kevinhsykes Which T3 Copy action triggers it (for example a message's Copy button, a code block, or right-click › Copy Link), and could you start T3 with WAYLAND_DEBUG=client, reproduce once with harmless text, and attach the log lines around the Copy click that mention set_selection, wl_data_source or cancelled, along with your launch flags and any input method (fcitx5, ibus), pen tablet or touchscreen?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions