fix(x11): use xclip for persistent clipboard ownership - #362
Conversation
In X11, the owning process must stay alive to serve SelectionRequest events. The previous native implementation held ownership for only 1 second before exiting, causing the clipboard to appear empty to other apps after the TUI closed. - Use xclip to copy text/images so ownership persists after TUI closes - Check TARGETS atom before requesting image data to avoid xclip returning garbage bytes for unsupported formats `xclip` must be installed for X11 clipboard to work correctly. `xsel` could be impelmented the same way too except for images which are unsupported
f8bf1ff to
1aca5ba
Compare
…parent terminal lifetime
|
Hey, just wanted to say, that I just merged this patch into my own repo, and it seems to be working (had the issue where I couldn't paste anything after selecting - the clipboard buffer was just getting empty, and I was using ghostty) |
Do you mean the tool is storing the copied text/media but not pasting when selecting an item from clipse list ? |
|
Yeah, the clipse was storing the data inside, but wasn't passing it to my clipboard. Your patch fixed that. |
|
oh okay then. I thought you had the issue after the patch |
|
Can confirm that this works perfectly under Arch Linux using BSPWM and Kitty. |
Description
In X11, the owning process must stay alive to serve SelectionRequest events. The previous native implementation held ownership for only 1 second before exiting, causing the clipboard to appear empty to other apps after the TUI closed.
Fixes #45
Changes
Notes
xclipmust be installed for X11 clipboard to work correctly.xselcould be impelmented the same way too except for images which are unsupported