[x] I have read through the manual page of fzf (man fzf)
[x] I have searched through the existing issues
Using GitFiles or other commands that uses the built-in preview.sh script does not work when using (n)vim from git bash interactive shell. You'll see an error in the preview as follows:
/usr/bin/bash: line 1: C:PROGRA~1Gitusrbinbash.exe: command not found
I set g:fzf_vim.preview_bash to C:/Progra~1/Git/bin/bash.exe but the error persisted as if the preview_bash value was being ignored. I found the issue comes from the function s:bash as it does the following:
let custom_bash = s:conf('preview_bash', '')
let git_bash = 'C:\Program Files\Git\bin\bash.exe'
let candidates = filter(s:is_win ? [custom_bash, 'bash', git_bash] : [custom_bash, 'bash'], 'len(v:val)')
let found = filter(map(copy(candidates), 'exepath(v:val)'), 'len(v:val)')
The exepath(v:val) will expand the path to a windows style path with backlashes. E.g. the following
Which doesn't work when the interactive shell is git bash. If I manually set the value of s:bash with the content of g:fzf_vim.preview_bash as is (forward slash), then the preview script works fine.
Could the behavior of evaluating the path for g:fzf_vim.preview_bash be changed to take the string as is? If not, could it be a separate variable that is taken as is for the bash preview?
man fzf
)Using
GitFiles
or other commands that uses the built-in preview.sh script does not work when using (n)vim from git bash interactive shell. You'll see an error in the preview as follows:I set
g:fzf_vim.preview_bash
toC:/Progra~1/Git/bin/bash.exe
but the error persisted as if thepreview_bash
value was being ignored. I found the issue comes from the functions:bash
as it does the following:The
exepath(v:val)
will expand the path to a windows style path with backlashes. E.g. the followingwill return
Which doesn't work when the interactive shell is git bash. If I manually set the value of
s:bash
with the content ofg:fzf_vim.preview_bash
as is (forward slash), then the preview script works fine.Could the behavior of evaluating the path for
g:fzf_vim.preview_bash
be changed to take the string as is? If not, could it be a separate variable that is taken as is for the bash preview?Info