From 62f3061f482248a8577fb1308f0e94b8fde7174c Mon Sep 17 00:00:00 2001 From: "Kenneth Benzie (Benie)" Date: Tue, 26 Aug 2025 20:40:41 +0100 Subject: [PATCH] Use tmux clipboard provider on Wayland On Gnome Shell on Wayland `wl-copy` is automatically detected but using it requires switching focus to the temporary invisible window it creates as a workaround to the Wayland security feature that only the focused application can interact with the clipboard. This does not happen when `nvim` is run outside of `tmux`, so I can only assume that `tmux` is seen to be the focused application, even though it's running inside `kitty`, rather than `nvim` when running inside `tmux`. --- plugin/settings.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugin/settings.lua b/plugin/settings.lua index ce990f2..7ca9dd8 100644 --- a/plugin/settings.lua +++ b/plugin/settings.lua @@ -3,6 +3,12 @@ vim.g.loaded_node_provider = 0 vim.g.loaded_perl_provider = 0 vim.g.loaded_ruby_provider = 0 +if vim.env.TMUX ~= nil and vim.env.WAYLAND_DISPLAY ~= nil then + -- Use tmux instead of wl-clipboard on Wayland to avoid annoying notification + -- popups when copying/pasting from the system clipboard. + vim.g.clipboard = "tmux" +end + -- Keep cursor from buffer edges vim.opt.sidescrolloff = 5