mirror of https://github.com/folke/lazy.nvim.git
fix: use jobstart instead of system to open urls
This commit is contained in:
parent
5ecc988610
commit
1754056475
|
@ -11,15 +11,16 @@ function M.open(uri)
|
||||||
end
|
end
|
||||||
local cmd
|
local cmd
|
||||||
if vim.fn.has("win32") == 1 then
|
if vim.fn.has("win32") == 1 then
|
||||||
cmd = { "cmd.exe", "/c", "start", '""', vim.fn.shellescape(uri) }
|
cmd = { "explorer", uri }
|
||||||
|
-- cmd = { 'cmd.exe', '/c', 'start', '""', uri }
|
||||||
elseif vim.fn.has("macunix") == 1 then
|
elseif vim.fn.has("macunix") == 1 then
|
||||||
cmd = { "open", uri }
|
cmd = { "open", uri }
|
||||||
else
|
else
|
||||||
cmd = { "xdg-open", uri }
|
cmd = { "xdg-open", uri }
|
||||||
end
|
end
|
||||||
|
|
||||||
local ret = vim.fn.system(cmd)
|
local ret = vim.fn.jobstart(cmd, { detach = true })
|
||||||
if vim.v.shell_error ~= 0 then
|
if ret <= 0 then
|
||||||
local msg = {
|
local msg = {
|
||||||
"Failed to open uri",
|
"Failed to open uri",
|
||||||
ret,
|
ret,
|
||||||
|
|
Loading…
Reference in New Issue