fix: keep wayland clipboard copies responsive - #3015
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughWayland clipboard writes now return after ChangesWayland clipboard handling
Estimated code review effort: 3 (Moderate) | ~15–30 minutes Merge Risk: ⚪ Minimal · up to This localized Wayland clipboard responsiveness change is merge-ready after normal checks and review; no actionable merge-blocking risk remains. Sequence Diagram(s)sequenceDiagram
participant run_clipboard_command
participant wl-copy
participant clipboard_reaper_thread
run_clipboard_command->>wl-copy: Start process and send clipboard data
wl-copy-->>run_clipboard_command: Receive data
run_clipboard_command-->>run_clipboard_command: Return success without waiting
clipboard_reaper_thread->>wl-copy: Wait for process exit
clipboard_reaper_thread->>clipboard_reaper_thread: Log exit failure if present
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Issue
On Wayland, double-clicking a token can freeze Herdr while
wl-copykeeps serving the clipboard selection. Existing and newly attached clients then stop responding.Problem
Herdr waited for
wl-copyto exit after sending the copied text. A clipboard owner can stay alive until another application replaces the selection, so that wait blocked Herdr's control path.How did we fix it?
Herdr now returns after handing the text to
wl-copyand reaps the clipboard owner on a dedicated thread when it eventually exits. Other Linux clipboard helpers still wait for and report their exit status as before.Verification
The regression test blocked before the fix while a fake
wl-copyremained alive. It now verifies immediate return, exact arguments and text, and eventual child reaping. Focused tests, formatting, and clippy pass. The full suite passed 3,487 of 3,488 tests;live_server_holds_one_pty_master_fd_per_panestill fails because its replacement server does not appear, and the same failure reproduces with this change removed.refs #3014