I upgrade from Ubuntu 18.04 to 22.04 and having clipboard clearing issues using xsel
If I ctrl+c in a text editor and run xsel -cb; xsel -cp; xsel -cs
in terminal, the clipboard doesn't clear (ctrl+v continues to paste content). Additionally, xsel -b
does not return anything. However ctrl+v does paste the copied content with ctrl+c.
I also have a keyboard shortcut to clear the clipboard with the same behavior (command: bash -c "xsel -cb; xsel -cp; xsel -cs"
)
Now... once I use xsel
in terminal with a copy command: echo hello|xsel -b
everything works normally going forward.
The keyboard shortcut works as expected, even on subsequent ctrl+c content, until I log off the user or reboot the machine.
I've tried purging xsel and re-installing, but that has not resolved the issue. Any thoughts on how I can resolve?
xsel does not work because, upgrading to 22.04, you are now on Wayland rather than Xorg. Two options
Option 1. Replace
xsel
by a tool for the Wayland clipboard, e.g.wl-copy
andwl-paste
of thewl-clipboard
package.Option 2. Log out, then log back in in an X11 session. X11 is still available and fully working. It just is not anymore the default, to the extent that users are moved to Wayland even during an upgrade.