Fix file URI clipboard — proper format with CRLF, no stray arg

This commit is contained in:
pax 2026-04-05 15:38:28 -05:00
parent 5c53ee7e87
commit a8da23ab1d

View File

@ -1968,9 +1968,9 @@ class BooruApp(QMainWindow):
with open(path, "rb") as f: with open(path, "rb") as f:
subprocess.run(["wl-copy", "--type", _MIMES[ext]], stdin=f, timeout=10) subprocess.run(["wl-copy", "--type", _MIMES[ext]], stdin=f, timeout=10)
else: else:
# Videos/other: copy as file URI # Videos/other: copy as file URI for file manager paste
uri = f"file://{Path(path).resolve()}" uri = f"file://{Path(path).resolve()}\r\n"
subprocess.run(["wl-copy", "--type", "text/uri-list", uri], input=uri.encode(), timeout=5) subprocess.run(["wl-copy", "--type", "text/uri-list"], input=uri.encode(), timeout=5)
self._status.showMessage(f"Copied to clipboard: {Path(path).name}") self._status.showMessage(f"Copied to clipboard: {Path(path).name}")
return return
except Exception as e: except Exception as e: