junegunn / fzf.vim

fzf :heart: vim
MIT License
9.62k stars 584 forks source link

FZF Vim Plugin on Windows Produces Error E282: "Cannot read from..." #1566

Closed mjklemm closed 3 weeks ago

mjklemm commented 3 weeks ago

Checklist

Output of :echo system(fzf#exec() .. ' --version')

n/a, gives error, FZF 0.55.0 installed

OS

Problem / Steps to reproduce

When trying to use FZF via the fzf.vim plugin, I'm getting the error shown in the screenshot below. This happens with commands like :Files, etc.

image

junegunn commented 3 weeks ago

n/a, gives error

What's the error message?

mjklemm commented 3 weeks ago

It's pretty much the same root cause as with the main issue: E282

image

mjklemm commented 3 weeks ago

Note sure, if it helps, but I dug a bit deeper into vim.vim. The issues seems to come from the invocation of system in s:winpath(). I seem to be able to reproduce this simply using :echo system('dir') in Vim.

mjklemm commented 3 weeks ago

I think I have fouind the issue: Vim was trying to issue zsh on Windows, which of course does not work that well. :-) I'm closing this.

junegunn commented 3 weeks ago

set shell=... is usually the culprit.

mjklemm commented 3 weeks ago

That was indeed the issue! Too bad that Vim does not produce a useful error message in that case.

The one weird thing, but that's how cmd.exe behaves, is that it opens a window the first time you type :Files. I'll dig a bit to figure out if that can be avoided somehow.

Thanks for the remote four-eye debugging. Opening this issue was helpful in making me look deeper into this.