diff --git a/plugin/fzf.vim b/plugin/fzf.vim index 7f72199851e..2481f08b624 100644 --- a/plugin/fzf.vim +++ b/plugin/fzf.vim @@ -171,7 +171,14 @@ function s:get_version(bin) if has_key(s:versions, a:bin) return s:versions[a:bin] end - let command = (&shell =~ 'powershell\|pwsh' ? '&' : '') . s:fzf_call('shellescape', a:bin) . ' --version --no-height' + if &shell =~ 'powershell\|pwsh' + let command = '& ' . s:fzf_call('shellescape', a:bin) . ' --version --no-height' + elseif &shell =~# '\$' + let command = [a:bin, '--version', '--no-height'] + else + let command = s:fzf_call('shellescape', a:bin) . ' --version --no-height' + endif + let output = systemlist(command) if v:shell_error || empty(output) return ''