Bring back clipboard watchers that die

Clipboard history is fed by two wl-paste --watch processes started once
when the shell loads. When one dies, nothing notices: copying still
works, the picker still opens, and the old entries are all still there,
so history just silently stops recording until the next shell reload.

Respawn them on exit instead. The one-shot timer both coalesces the case
where both watchers die together and keeps a wl-paste that cannot start
at all from spinning as fast as fork allows.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
David Heinemeier Hansson
2026-07-28 08:19:57 -07:00
co-authored by Claude Opus 5
parent cf8102af92
commit 234ac7b3b6
2 changed files with 20 additions and 0 deletions
+5
View File
@@ -174,6 +174,11 @@ assert(
clipboardQml.includes('command: ["pkill", "-f", "wl-paste .*--watch .*/shell/plugins/clipboard/capture\\\\.sh"]'),
'clipboard init reaps stale watchers before starting new ones'
)
assertEqual(
(clipboardQml.match(/onExited: watchRestartTimer\.restart\(\)/g) || []).length,
2,
'clipboard respawns both watchers when they die'
)
JS
TMPDIR=$(mktemp -d)