Skip to content

Commit 066b12e

Browse files
committed
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)
1 parent 68e3044 commit 066b12e

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

src/testdir/test_terminal3.vim

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,18 @@ func Test_terminal_shell_option()
4343
bwipe!
4444
elseif has('win32')
4545
" dir is a shell builtin command, should fail without a shell.
46+
" However, if dir.exe (which might be provided by Cygwin/MSYS2) exists in
47+
" the %PATH%, "term dir" succeeds unintentionally. Use dir.com instead.
4648
try
47-
term dir /b runtest.vim
48-
call WaitForAssert({-> assert_match('job failed\|cannot access .*: No such file or directory', term_getline(bufnr(), 1))})
49+
term dir.com /b runtest.vim
50+
call WaitForAssert({-> assert_match('job failed', term_getline(bufnr(), 1))})
4951
catch /CreateProcess/
5052
" ignore
5153
endtry
5254
bwipe!
5355

54-
term ++shell dir /b runtest.vim
56+
" This should execute the dir builtin command even with ".com".
57+
term ++shell dir.com /b runtest.vim
5558
call WaitForAssert({-> assert_match('runtest.vim', term_getline(bufnr(), 1))})
5659
bwipe!
5760
endif

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -754,6 +754,8 @@ static char *(features[]) =
754754

755755
static int included_patches[] =
756756
{ /* Add new patch number below this line */
757+
/**/
758+
1312,
757759
/**/
758760
1311,
759761
/**/

0 commit comments

Comments
 (0)