registers.nvim icon indicating copy to clipboard operation
registers.nvim copied to clipboard

"Clipboard: no provider" error message when used on headless hosts

Open prg318 opened this issue 3 years ago • 4 comments

When using this awesome plugin on a headless machine that's not running X11 or wayland (or any clipboard proxying SSH magic), the following error message is displayed by neovim (version 0.6.1) when opening the registers.nvim UI:

clipboard: No provider. Try ":checkhealth" or ":h clipboard".
clipboard: No provider. Try ":checkhealth" or ":h clipboard".
Press ENTER or type command to continue

Nothing in my configuration sets the clipboard, but it seems to be upset that an X11/wayland clipboard tool is not available. Ideally, the plugin should continue without warning and use the neovim internal clipboard

Steps to reproduce:

  1. Create a chroot or VM and install latest nvim
  2. Add registers.vnim to config
  3. Try to open registers panel without installing X11 or wayland

Let me know if there is anything else I can do to help with this. Thanks!

prg318 avatar Jan 16 '22 04:01 prg318

I've looked into it, but I couldn't find a way to detect whether a clipboard register is available. It would be greatly appreciated if anyone has any tips regarding detecting this.

tversteeg avatar Jan 30 '22 11:01 tversteeg

We could avoid this error message by disabling clipboard totally. Try to adding following snippet to init.vim:

let g:clipboard = {"name": "void", "copy": {}, "paste": {}}
let g:clipboard.copy["+"] = {-> v:true}
let g:clipboard.paste["+"] = {-> []}
let g:clipboard.copy["*"] = g:clipboard.copy["+"]
let g:clipboard.paste["*"] = g:clipboard.paste["+"]

Creling avatar Jul 15 '22 10:07 Creling

Can a setting be added to turn off the clipboard register handling by the plugin? Or better if '+' is not listed in the g:registers_show variable then the plugin doesn't deal with the clipboard register.

kkanhere avatar Aug 01 '22 02:08 kkanhere

Actually removing '+*' from g:registers_show config does seem to work. So kindly ignore the above comment and thanks!

kkanhere avatar Aug 01 '22 03:08 kkanhere