# Vim runtime support library
#
# Maintainer: The Vim Project <https://github.com/vim/vim>
-# Last Change: 2026 Mar 10
+# Last Change: 2026 Apr 06
export def IsSafeExecutable(filetype: string, executable: string): bool
if empty(exepath(executable))
export def Launch(args: string)
# Use job_start, because using !xdg-open is known not to work with zsh
# ignore signals on exit
- job_start(split(args), {'stoponexit': ''})
+ job_start(['sh', '-c', args], {'stoponexit': '', 'in_io': 'null', 'out_io': 'null', 'err_io': 'null'})
enddef
endif
elseif has('win32')
setlocal shell&
defer setbufvar('%', '&shell', shell)
endif
- if has('unix') && !has('win32unix') && !exists('$WSL_DISTRO_NAME')
- # Linux: using job_start, so do not use shellescape.
- Launch($"{Viewer()} {file}")
- else
- # Windows/WSL/Cygwin: NEEDS shellescape because Launch uses '!'
- Launch($"{Viewer()} {shellescape(file, 1)}")
- endif
+ Launch($"{Viewer()} {shellescape(file, 1)}")
enddef
# Uncomment this line to check for compilation errors early