- Use `:!start` directly, discard the using of `explorer.exe`.
- Update the document in `eval.txt`.
closes: #18985
Signed-off-by: Mao-Yining <mao.yining@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
endif
elseif has('win32')
export def Launch(args: string)
- const shell = (&shell =~? '\<cmd\.exe\>') ? '' : 'cmd.exe /c'
- const quotes = empty(shell) ? '' : '""'
- execute $'silent ! {shell} start {quotes} /b {args} {Redir()}' | redraw!
+ try
+ execute ':silent !start' args | redraw!
+ catch /^Vim(!):E371:/
+ echohl ErrorMsg
+ echom "dist#vim9#Launch(): can not start" args
+ echohl None
+ endtry
enddef
else
export def Launch(dummy: string)
if has('win32unix')
# (cyg)start suffices
os_viewer = ''
-# Windows / WSL
+# Windows
+elseif has('win32')
+ os_viewer = '' # Use :!start
+# WSL
elseif executable('explorer.exe')
os_viewer = 'explorer.exe'
# Linux / BSD
-*eval.txt* For Vim version 9.1. Last change: 2025 Dec 19
+*eval.txt* For Vim version 9.1. Last change: 2025 Dec 21
VIM REFERENCE MANUAL by Bram Moolenaar
dist#vim9#Open(file: string) ~
Opens `path` with the system default handler (macOS `open`, Windows
-`explorer.exe`, Linux `xdg-open`, …). If the variable |g:Openprg| exists the
+`start`, Linux `xdg-open`, …). If the variable |g:Openprg| exists the
string specified in the variable is used instead.
The |:Open| user command uses file completion for its argument.