remote-nvim.nvim
remote-nvim.nvim copied to clipboard
implemented workaround for nvim copy via OSC52
When using Neovim in a remote session, OSC52 clipboard sequences are being printed to the local terminal instead of being routed to the remote terminal. This breaks clipboard synchronization for remote users. https://github.com/neovim/neovim/issues/28792
that is a workaround to the problem in #146 that on the remote-nvim side that is connected to ssh it will parse the osc52 and pass it to clipborad.
In config need to add something like:
if os.getenv("SSH_CLIENT") ~= nil then
local function noop()
return {}
end
vim.g.clipboard = {
name = "OSC 52",
copy = {
["+"] = require("vim.ui.clipboard.osc52").copy("+"),
["*"] = require("vim.ui.clipboard.osc52").copy("*"),
},
-- NOTE: OSC 52 paste is a security risk, so most terminals disable it
paste = {
["+"] = noop,
["*"] = noop,
},
}
end