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

@@ -2877,7 +2877,7 @@ describe('API', function()
it('stream=job channel', function()
eq(3, eval("jobstart(['cat'], {'rpc': v:true})"))
local catpath = eval('exepath("cat")')
local catpath = vim.fs.normalize(eval('exepath("cat")'))
local info = {
stream = 'job',
id = 3,
@@ -2936,7 +2936,7 @@ describe('API', function()
eq(1, api.nvim_get_current_buf())
eq(3, api.nvim_get_option_value('channel', { buf = 1 }))
local info = term_channel_info(3, 1, { eval('exepath(&shell)') })
local info = term_channel_info(3, 1, { vim.fs.normalize(eval('exepath(&shell)')) })
local event = api.nvim_get_var('opened_event')
if not is_os('win') then
info.pty = event.info.pty