fix(path): exepath() should respect 'shellslash' #39541

Problem:
`gx` relies on `exepath` to get the fullpath of `cmd.exe`,
and that path must use `\`; otherwise, luv's spawn will fail.

Solution:
Revert `slash_adjust` in `exepath`, so that it still respects 'shellslash'
This commit is contained in:
tao
2026-05-05 00:18:13 +08:00
committed by GitHub
parent cbedd537ac
commit 7e813c65f7
4 changed files with 15 additions and 3 deletions

View File

@@ -76,4 +76,10 @@ describe('exepath()', function()
end
)
end
it('respects shellslash #39524', function()
t.skip(not is_os('win'), "N/A: 'shellslash' only works on Windows")
local path = call('exepath', 'cmd.exe') ---@type string
t.ok(nil == path:find('/'))
end)
end)