From 175405647587d4d49e3b9c0992c6a8ae31cda706 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 20 Dec 2022 12:34:24 +0100 Subject: [PATCH] fix: use jobstart instead of system to open urls --- lua/lazy/util.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lua/lazy/util.lua b/lua/lazy/util.lua index 594d5b79..fdff2ad5 100644 --- a/lua/lazy/util.lua +++ b/lua/lazy/util.lua @@ -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,