]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
runtime(vim9): Check cmd.exe on WSL is executable
authorYasuhiro Matsumoto <mattn.jp@gmail.com>
Wed, 6 May 2026 18:24:51 +0000 (18:24 +0000)
committerChristian Brabandt <cb@256bit.org>
Wed, 6 May 2026 18:24:51 +0000 (18:24 +0000)
closes: #20150

Signed-off-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime/autoload/dist/vim9.vim

index 4d8785d4ae0f31d258b85a76a366fecb4f27f9c3..cd4022aba7fadb1b530ed8157b4ec49c0532229e 100644 (file)
@@ -3,7 +3,7 @@ vim9script
 # Vim runtime support library
 #
 # Maintainer:   The Vim Project <https://github.com/vim/vim>
-# Last Change:  2026 Apr 17
+# Last Change:  2026 May 06
 
 export def IsSafeExecutable(filetype: string, executable: string): bool
   if empty(exepath(executable))
@@ -51,7 +51,7 @@ if has('unix')
         execute $'silent !cmd /c start "" /b {args} {Redir()}' | redraw!
       enddef
     endif
-  elseif exists('$WSL_DISTRO_NAME') # use cmd.exe to start GUI apps in WSL
+  elseif exists('$WSL_DISTRO_NAME') && executable('cmd.exe') # use cmd.exe to start GUI apps in WSL
     export def Launch(args: string)
       const command = (args =~? '\v<\f+\.(exe|com|bat|cmd)>')
         ? $'cmd.exe /c start /b {args} {Redir()}'