Skip to content

Commit b94fdae

Browse files
committed
replace commandv with subprocess_detached
1 parent 90e89d7 commit b94fdae

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

platform/win.lua

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,17 @@ self.tmp_dir = function()
2323
end
2424

2525
self.copy_to_clipboard = function(text)
26-
mp.commandv(
27-
"run", "powershell", "-NoLogo", "-NoProfile", "-WindowStyle", "Hidden", "-Command",
26+
local args = {
27+
"powershell", "-NoLogo", "-NoProfile", "-WindowStyle", "Hidden", "-Command",
2828
string.format(
29-
"Set-Clipboard ([Text.Encoding]::UTF8.GetString([Convert]::FromBase64String('%s')))",
30-
base64.enc(text)
29+
"Set-Clipboard ([Text.Encoding]::UTF8.GetString([Convert]::FromBase64String('%s')))",
30+
base64.enc(text)
3131
)
32+
}
33+
return h.subprocess_detached(
34+
args,
35+
function()
36+
end
3237
)
3338
end
3439

0 commit comments

Comments
 (0)