fix: clean up empty file after failed wl-paste clipboard extraction

When wl-paste produces empty output, the destination file was left
on disk as a 0-byte orphan. Now explicitly removed before returning
False.
This commit is contained in:
0xbyt4
2026-03-09 17:17:10 +03:00
parent c754135965
commit 58b756f04c

View File

@@ -254,6 +254,7 @@ def _wayland_save(dest: Path) -> bool:
)
if not dest.exists() or dest.stat().st_size == 0:
dest.unlink(missing_ok=True)
return False
# BMP needs conversion to PNG (common in WSLg where only BMP