From 58b756f04c26edc79ccc1e8ff8b27e1c33da1120 Mon Sep 17 00:00:00 2001 From: 0xbyt4 <35742124+0xbyt4@users.noreply.github.com> Date: Mon, 9 Mar 2026 17:17:10 +0300 Subject: [PATCH] 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. --- hermes_cli/clipboard.py | 1 + 1 file changed, 1 insertion(+) diff --git a/hermes_cli/clipboard.py b/hermes_cli/clipboard.py index 6373cfc8b..bdead70b1 100644 --- a/hermes_cli/clipboard.py +++ b/hermes_cli/clipboard.py @@ -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