20
submitted 10 months ago by [email protected] to c/[email protected]

I start my coding workspaces in tmux sessions which persist when I log out. If I switch from a wayland session to an x11 session, then my copy and paste functionality in those neovim sessions are broken because it's still trying to use wl-copy. To be more precise:

  1. Start a wayland session.
  2. Open a terminal and start a tmux session.
  3. Open neovim and do some work.
  4. Log out of wayland, log into an X11 environment
  5. Open a terminal and reconnect to the tmux session
  6. "+y broken. clipboard: error invoking wl-copy: Failed to connect to a Wayland server...

Restarting neovim isn't sufficient. I have to restart the entire tmux session or switch back to wayland. Is there some short cut I can take here?

you are viewing a single comment's thread
view the rest of the comments
[-] [email protected] 4 points 10 months ago

Manipulating vim.g.clipboard is the trick. I'll have to write some command that sets the clipboard provider directly.

this post was submitted on 12 Sep 2024
20 points (95.5% liked)

Neovim

2535 readers
1 users here now

founded 2 years ago
MODERATORS