Skip to content

Commit 66787b8

Browse files
committed
Revert shellescape behaviour, explicitly avoid escaping on :Buffers.
1 parent f729a56 commit 66787b8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

plugin/fzf.vim

+4-2
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ function! s:shellesc_cmd(arg)
9494
endfunction
9595

9696
function! fzf#shellescape(arg, ...)
97-
let shell = get(a:000, 0, s:is_win_cmd ? 'cmd.exe' : 'sh')
97+
let shell = get(a:000, 0, s:is_win ? 'cmd.exe' : 'sh')
9898
if shell =~# 'cmd.exe$'
9999
return s:shellesc_cmd(a:arg)
100100
endif
@@ -486,7 +486,9 @@ try
486486
elseif type == 3
487487
let temps.input = s:fzf_tempname()
488488
call s:writefile(source, temps.input)
489-
let source_command = (s:is_win_cmd ? 'type ' : 'cat ').fzf#shellescape(temps.input)
489+
" Disable shell escape for git bash, as it breaks the command here
490+
let source_command = (s:is_win_cmd ? 'type ' : 'cat ')
491+
\.(!s:is_win || !exists('$SHELL')) ? fzf#shellescape(temps.input) : temps.input
490492
else
491493
throw 'Invalid source type'
492494
endif

0 commit comments

Comments
 (0)