Skip to content

Commit

Permalink
fix: use jobstart instead of system to open urls
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Dec 20, 2022
1 parent 5ecc988 commit 1754056
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lua/lazy/util.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 1754056

Please sign in to comment.