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
|
||||
local cmd
|
||||
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
|
||||
cmd = { "open", uri }
|
||||
else
|
||||
cmd = { "xdg-open", uri }
|
||||
end
|
||||
|
||||
local ret = vim.fn.system(cmd)
|
||||
if vim.v.shell_error ~= 0 then
|
||||
local ret = vim.fn.jobstart(cmd, { detach = true })
|
||||
if ret <= 0 then
|
||||
local msg = {
|
||||
"Failed to open uri",
|
||||
ret,
|
||||
|
|
Loading…
Reference in New Issue