From ee8361dad52192e869cd73270a5e87c95c3b5003 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 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugin/settings.lua b/plugin/settings.lua index ce990f2..e9a2085 100644 --- a/plugin/settings.lua +++ b/plugin/settings.lua @@ -3,6 +3,10 @@ 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 + vim.g.clipboard = "tmux" +end + -- Keep cursor from buffer edges vim.opt.sidescrolloff = 5