Fix file URI clipboard — proper format with CRLF, no stray arg
This commit is contained in:
parent
5c53ee7e87
commit
a8da23ab1d
@ -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:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user