Description
I use Alacritty on Wayland, specifically with the Sway window manager. Alacritty uses this underlying library to handle text copying and pasting. When pasting text from the clipboard with Alacritty (using default Ctrl+Shift+V key binding) the pasted text will actually be older, previously copied text. Pasting again will eventually paste the most recently copied text, however it may take several repetitions before it "bubbles" up.
This only seems to occur on a very long running Alacritty instance. For example, I have several Alacritty instances open, and the recently started processes do not exhibit this issue, but a very old instance does exhibit this behavior and continues to do so.
Steps to reproduce:
- Start Alacritty and use the same instance over the course of many days.
- Copy text to clipboard using any means (other applications that have access to Wayland clipboard or Alacritty itself)
- Paste text using Alacritty. The pasted text will incorrectly be previously copied text. Subsequent pastes will eventually paste the most recently copied text.
Example:
- Copy "foo" from text using some application.
- In Alacritty at a shell, execute a Paste hot key (Ctrl+Shift+V by default)
- "foo" should be output to the screen. If it isn't, it may be "queued up". Keep retrying the Paste operation until "foo" is outputted.
- Copy "bar" from text using some application.
- Repeat Paste hot key an arbitrary amount of times. Alacritty will output "foo" each time until eventually "bar" is output
Note: In the above, "some application" can be anything that is able to copy text to the Wayland clipboard. The above example occurs for both copying using Alacritty's highlighting and Ctrl+Shift+C, or copying text in Firefox.
Here is a Youtube video I created which demonstrates the issue: