#3573·neovide

System clipboard integration broken on GNOME

Author: hackelCreated Sep 20, 2026Updated Sep 20, 2026
Labelsbug

Describe the bug Previously, wl-clipboard used a hack to get around GNOME's security restrictions preventing background processes from accessing the system clipboard. Recently with the release of GNOME 50 (or possibly earlier?), this vulnerability was fixed, so now using wl-copy or wl-paste hangs indefinitely.

Neovide has first-party clipboard support built-in that works perfectly with GNOME, since Neovide is the focused app, but using it is currently overly complicated. It is only enabled by default when using a remote neovim server or on WSL. I would like to propose enabling the native clipboard integration automatically at least when GNOME is detected, if not all the time on Linux. As a GUI app, I can't personally think of any reason anyone wouldn't want this, but I'm sure I'm missing some edge case.

It looks like it would be a simple patch that I'm happy to submit if this approach is acceptable.

To Reproduce Steps to reproduce the behavior:

  1. Install Neovide on a Linux system running GNOME 50+
  2. Set vim.opt.clipboard:append("unnamedplus") in init.lua
  3. Run Neovide and try to put some text from the system clipboard
  4. Neovide freezes indefinitely (can be broken with Ctrl-C or by killing wl-paste)

Expected behavior The copied content appears in the document.

Desktop (please complete the following information):

  • OS: Ubuntu 26.04
  • Neovide Version: 0.16.2
  • Neovim Version: 0.12.5

Workaround For anyone else dealing with this issue, this is what you need to add to your init.lua to switch to the native clipboard right now:

lua
-- Enable native Neovide clipboard (from https://github.com/neovide/neovide/blob/0.16.2/lua/init.lua)
if vim.g.neovide and (vim.env.XDG_CURRENT_DESKTOP or ""):find("GNOME", 1, true) then
    local function rpcrequest(method, ...) return vim.rpcrequest(vim.g.neovide_channel_id, method, ...) end
    local function set_clipboard(register) return function(lines) rpcrequest("neovide.set_clipboard", lines, register) end end
    local function get_clipboard(register) return function() return rpcrequest("neovide.get_clipboard", register) end end

    vim.g.clipboard = {
        name = "neovide",
        copy = {
            ["+"] = set_clipboard("+"),
            ["*"] = set_clipboard("*"),
        },
        paste = {
            ["+"] = get_clipboard("+"),
            ["*"] = get_clipboard("*"),
        },
        cache_enabled = false,
    }
    vim.g.loaded_clipboard_provider = nil
    vim.cmd.runtime("autoload/provider/clipboard.vim")

    -- Enable system clipboard sync
    vim.opt.clipboard:append("unnamedplus")

    -- Automatically copy selected text to primary clipboard when releasing the left mouse button
    for i = 1, 4 do
        local key = i == 1 and '<LeftRelease>' or string.format('<%d-LeftRelease>', i)
        vim.keymap.set('v', key, '"*ygv', { desc = string.format('Copy mouse selection to primary clipboard (%d-click)', i) })
    end
end