Repository navigation
Conversation
The clipboard history watched only image/png, so an image an app offered as JPEG, WebP, GIF, BMP or TIFF alone never reached the history. Watch for any image type instead, and fall back to a stored format when the first one on offer isn't, so an SVG offered ahead of PNG still records the PNG.
[Medium impact] The PR appears safe to merge; both previous findings are addressed. SummaryThe image watcher now accepts all image types instead of PNG alone.
Reviews (2) · Last reviewed commit: "Identify watched clipboard images from t..." · Reviewed by Greptile |
|
Reviewed head Codex High, Opus 5.5 High and muse-wonder via pi (thinking high) found no actionable defects. The reviewers agreed; their independence is not guaranteed. No code changes were needed. #11715 addresses a different reported symptom by removing image history, so it overlaps this watcher without being a duplicate. This is waiting on the maintainer's decision. |


What changes
The clipboard history watches
image/png, so an image offered only as JPEG, WebP, GIF, BMP or TIFF never reaches the history, even thoughcapture.shalready stores those formats.The watcher now uses
wl-paste --type image --watch. Because it receives bytes without a MIME type,capture.shidentifies the captured file withfile --mime-typeinstead of inferring its format from a separate query of the current clipboard. This keeps the saved MIME type and extension tied to the captured bytes even when another image is copied meanwhile.fileis already a dependency of Arch's base package.If the captured format is unsupported, such as SVG, the script explicitly requests a supported representation from the available types, preserving the existing SVG-before-PNG fallback. Empty or timed-out reads are dropped without taking this fallback, and temporary unsupported files are removed before retrying.
The explicit
image/<type>argument still works, so watchers started before the update keep recording until the shell restarts.#11715 changes the same watcher in the opposite direction: it removes image history. Its review could not reproduce the reported deadlock; this PR keeps the watcher and broadens the formats it records.
Verification
bash test/shell.d/clipboard-test.sh: all 74 checks pass..jpgextension.image/pngwith a.pngextension.image/jpegwhen the clipboard changes; the revised script labels them correctly.Screenshots
No visible change: the panel layout is unchanged; images copied in formats other than PNG now enter history.