commit c87d92c3b4a9955010ea1096886eb2706f8144f0
parent 03d6cf7aae4a72c7221a4fb8ebb14a7c8603ba18
Author: ymich9963 <79522843+ymich9963@users.noreply.github.com>
Date: Sun, 30 Nov 2025 05:11:43 +0000
fix(ui.open): use "start" instead of deprecated "rundll32" #36731
Problem:
The rundll32 utility is a leftover from Windows 95, and it has
been deprecated since at least Windows Vista.
Solution:
Use the start command through Command Prompt instead.
Diffstat:
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/runtime/lua/vim/ui.lua b/runtime/lua/vim/ui.lua
@@ -169,11 +169,7 @@ function M.open(path, opt)
elseif vim.fn.has('mac') == 1 then
cmd = { 'open', path }
elseif vim.fn.has('win32') == 1 then
- if vim.fn.executable('rundll32') == 1 then
- cmd = { 'rundll32', 'url.dll,FileProtocolHandler', path }
- else
- return nil, 'vim.ui.open: rundll32 not found'
- end
+ cmd = { 'cmd.exe', '/c', 'start', '', path }
elseif vim.fn.executable('xdg-open') == 1 then
cmd = { 'xdg-open', path }
job_opt.stdout = false