Bruno BELANYI
2ffb8e6ee6
All checks were successful
continuous-integration/drone/push Build is passing
I do get the message when copying into the clipboard while ssh-ing. But trying to paste from my system clipboard shows that it did *not* get copied. This seems to only happen inside tmux. However tmux itself *does* copy to the clipboard correctly through OSC52.
18 lines
371 B
Lua
18 lines
371 B
Lua
if not require("ambroisie.utils").is_ssh() then
|
|
return
|
|
end
|
|
|
|
local function copy(lines, _)
|
|
require('osc52').copy(table.concat(lines, '\n'))
|
|
end
|
|
|
|
local function paste()
|
|
return {vim.fn.split(vim.fn.getreg(''), '\n'), vim.fn.getregtype('')}
|
|
end
|
|
|
|
vim.g.clipboard = {
|
|
name = 'osc52',
|
|
copy = {['+'] = copy, ['*'] = copy},
|
|
paste = {['+'] = paste, ['*'] = paste},
|
|
}
|