Skip to content

Commit 1754056

Browse files
committed
fix: use jobstart instead of system to open urls
1 parent 5ecc988 commit 1754056

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lua/lazy/util.lua

+4-3
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,16 @@ function M.open(uri)
1111
end
1212
local cmd
1313
if vim.fn.has("win32") == 1 then
14-
cmd = { "cmd.exe", "/c", "start", '""', vim.fn.shellescape(uri) }
14+
cmd = { "explorer", uri }
15+
-- cmd = { 'cmd.exe', '/c', 'start', '""', uri }
1516
elseif vim.fn.has("macunix") == 1 then
1617
cmd = { "open", uri }
1718
else
1819
cmd = { "xdg-open", uri }
1920
end
2021

21-
local ret = vim.fn.system(cmd)
22-
if vim.v.shell_error ~= 0 then
22+
local ret = vim.fn.jobstart(cmd, { detach = true })
23+
if ret <= 0 then
2324
local msg = {
2425
"Failed to open uri",
2526
ret,

0 commit comments

Comments
 (0)