From: Yasuhiro Matsumoto Date: Wed, 6 May 2026 18:24:51 +0000 (+0000) Subject: runtime(vim9): Check cmd.exe on WSL is executable X-Git-Tag: v9.2.0450~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4cbdef8e30cd5da5d3a0941ab88bf082b0b1e164;p=thirdparty%2Fvim.git runtime(vim9): Check cmd.exe on WSL is executable closes: #20150 Signed-off-by: Yasuhiro Matsumoto Signed-off-by: Christian Brabandt --- diff --git a/runtime/autoload/dist/vim9.vim b/runtime/autoload/dist/vim9.vim index 4d8785d4ae..cd4022aba7 100644 --- a/runtime/autoload/dist/vim9.vim +++ b/runtime/autoload/dist/vim9.vim @@ -3,7 +3,7 @@ vim9script # Vim runtime support library # # Maintainer: The Vim Project -# 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()}'