0
0
mirror of https://github.com/vim/vim.git synced 2025-10-12 06:44:06 -04:00

patch 8.2.1312: MS-Windows: terminal test may fail if dir.exe exists

Problem:    MS-Windows: terminal test may fail if dir.exe exists.
Solution:   Use dir.com. (Ken Takata, closes #6557)
This commit is contained in:
Bram Moolenaar
2020-07-28 21:40:27 +02:00
parent 68e30449a2
commit 066b12e36c
2 changed files with 8 additions and 3 deletions

View File

@@ -43,15 +43,18 @@ func Test_terminal_shell_option()
bwipe!
elseif has('win32')
" dir is a shell builtin command, should fail without a shell.
" However, if dir.exe (which might be provided by Cygwin/MSYS2) exists in
" the %PATH%, "term dir" succeeds unintentionally. Use dir.com instead.
try
term dir /b runtest.vim
call WaitForAssert({-> assert_match('job failed\|cannot access .*: No such file or directory', term_getline(bufnr(), 1))})
term dir.com /b runtest.vim
call WaitForAssert({-> assert_match('job failed', term_getline(bufnr(), 1))})
catch /CreateProcess/
" ignore
endtry
bwipe!
term ++shell dir /b runtest.vim
" This should execute the dir builtin command even with ".com".
term ++shell dir.com /b runtest.vim
call WaitForAssert({-> assert_match('runtest.vim', term_getline(bufnr(), 1))})
bwipe!
endif

View File

@@ -754,6 +754,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1312,
/**/
1311,
/**/