aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/ui.lua
diff options
context:
space:
mode:
authorAaron <aaronmgoldstein@gmail.com>2024-08-12 01:03:48 -0600
committerGitHub <noreply@github.com>2024-08-12 07:03:48 +0000
commit65a703e06063c85c3dd5fdb3ad4e1207a622ef30 (patch)
tree7185b090ac2a775d9ffb0f490f360fd1ae8c7bf7 /runtime/lua/vim/ui.lua
parent37d97e771e9140746629bc3e67ad2dfbd39888c5 (diff)
downloadrneovim-65a703e06063c85c3dd5fdb3ad4e1207a622ef30.tar.gz
rneovim-65a703e06063c85c3dd5fdb3ad4e1207a622ef30.tar.bz2
rneovim-65a703e06063c85c3dd5fdb3ad4e1207a622ef30.zip
fix(lua): ignore stdout and stderr for xdg-open
Ref #19724 Fix #29932
Diffstat (limited to 'runtime/lua/vim/ui.lua')
-rw-r--r--runtime/lua/vim/ui.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/runtime/lua/vim/ui.lua b/runtime/lua/vim/ui.lua
index 79638a044a..dccdbf32cc 100644
--- a/runtime/lua/vim/ui.lua
+++ b/runtime/lua/vim/ui.lua
@@ -140,6 +140,9 @@ function M.open(path)
end
local cmd --- @type string[]
+ local opts --- @type vim.SystemOpts
+
+ opts = { text = true, detach = true }
if vim.fn.has('mac') == 1 then
cmd = { 'open', path }
@@ -155,11 +158,13 @@ function M.open(path)
cmd = { 'explorer.exe', path }
elseif vim.fn.executable('xdg-open') == 1 then
cmd = { 'xdg-open', path }
+ opts.stdout = false
+ opts.stderr = false
else
return nil, 'vim.ui.open: no handler found (tried: wslview, explorer.exe, xdg-open)'
end
- return vim.system(cmd, { text = true, detach = true }), nil
+ return vim.system(cmd, opts), nil
end
--- Gets the URL at cursor, if any.