vim-patch:9.1.1948: Windows: Vim adds current directory to search path

Problem:  Windows: Vim always adds the current directory to search path.
          This should only happen when using cmd.exe as 'shell'. For
          example, powershell won't run binaries from the current
          directory.
Solution: Only add current directory to system path, when using cmd.exe
          as 'shell'.

related: vim/vim#10341
related: 083ec6d9a3b7

4d87c9742a

Co-authored-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
zeertzjq
2025-12-04 11:28:44 +08:00
parent ac3e2ca675
commit bfe007a187
5 changed files with 22 additions and 15 deletions

View File

@@ -202,9 +202,9 @@ describe('executable() (Windows)', function()
clear({ env = { PATHEXT = '' } })
command('set shell=sh')
for _, ext in ipairs(exts) do
eq(1, call('executable', 'test_executable_' .. ext .. '.' .. ext))
eq(0, call('executable', 'test_executable_' .. ext .. '.' .. ext))
end
eq(1, call('executable', 'test_executable_zzz.zzz'))
eq(0, call('executable', 'test_executable_zzz.zzz'))
end)
it("relative path, Unix-style 'shell' (backslashes)", function()