mirror of
https://github.com/neovim/neovim.git
synced 2026-07-31 12:49:11 +00:00
fix(system): use native path for Windows executables #40885
Problem: When 'shellslash' is set, exepath() returns forward-slashed paths. Passing that path to vim.system() can prevent cmd.exe from launching. Solution: Convert the resolved executable path to native separators before spawning. Add a Windows regression test for cmd.exe with 'shellslash' enabled.
This commit is contained in:
@@ -319,7 +319,8 @@ local function spawn(cmd, opts, on_exit, on_error)
|
||||
if is_win then
|
||||
local cmd1 = vim.fn.exepath(cmd)
|
||||
if cmd1 ~= '' then
|
||||
cmd = cmd1
|
||||
-- Use native separators when launching a resolved Windows executable.
|
||||
cmd = cmd1:gsub('/', '\\')
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user