Hacker News new | ask | show | jobs
by NobodyNada 1042 days ago
> Why would you run an interactive command with `:!` ?

I ran up against this limitation recently. The kitty terminal exposes APIs allowing processes to communicate with the terminal using escape codes. I wanted to configure Neovim to access the system clipboard using kitty’s API, so that I could copy/paste from within Neovim even over SSH. However, this would require Neovim to give the clipboard subprocess access to the controlling TTY. (Running it within :term would not work, as the escape sequences would thus be passed to Neovim’s virtual terminal emulator, not the instance of kitty that Neovim itself is running within.)

1 comments

neovim supports OSC 52 out of the box so clipboard over SSH should just wrk in kitty or any terminal that supports OSC 52. kitty of course supports a lot more than OSC 52 but for basic opy/paste of plain text, OSC 52 is sufficient.
Neovim doesn’t support OSC 52 unless I’m missing something. There’s an open issue: https://github.com/neovim/neovim/issues/3344

It’s easy to implement OSC 52 copy with a simple script/plugin, but apparently not paste without adding some code inside of Neovim itself.