ibhagwan / fzf-lua

Improved fzf.vim written in lua
GNU Affero General Public License v3.0
2.15k stars 141 forks source link

Windows: [Fzf-lua] fzf error 2: unsupported key: execute-silent(C #880

Closed mangelozzi closed 11 months ago

mangelozzi commented 11 months ago

Info

Reproduce

  1. Start nvim with sh -c "$(curl -s https://raw.githubusercontent.com/ibhagwan/fzf-lua/main/scripts/mini.sh)"
  2. :lua require('fzf-lua').setup({})
  3. :lua require("fzf-lua").files()
  4. The fzf window will open briefly then close again
  5. Check the messages with :mess to see the error: [Fzf-lua] fzf error 2: unsupported key: execute-silent(C

Description

fzf-lua works brilliantly for me on linux, but unfortunately at work I have to use windows. When I try to open it with:

:lua require("fzf-lua").files()

I get this error when I try to open it:

[Fzf-lua] fzf error 2: unsupported key: execute-silent(C

Have googled but come up empty. Anyone can think of a direction to try please let me know.

I don't know if this helps, but using gitbash on windows prints :lua print(vim.fn.has("win32")) prints 1, but it does not have the move command, it has the mv command cause gitbash is basically MING64 with our linux sh friends we love. So to test if windows maybe a better test is local is_win = vim.fn.executable('mv') == 0 ? If I try the files command using the cmd.exe shell I get the error:

E5108: Error executing lua: ...data\site\pack\packer\start\fzf-lua/lua/fzf-lua/path.lua:151: attempt to concatenate a nil value
stack traceback:
        ...data\site\pack\packer\start\fzf-lua/lua/fzf-lua/path.lua:151: in function 'normalize_cwd'
        ...data\site\pack\packer\start\fzf-lua/lua/fzf-lua/core.lua:660: in function 'set_header'
        ...ack\packer\start\fzf-lua/lua/fzf-lua/providers/files.lua:45: in function <...ack\packer\start\fzf-lua/lua/fzf-lua/providers/files.lua:40>

... which at least is different

ibhagwan commented 11 months ago

Hi @mangelozzi,

I’m not sure why this happens, execute-silent is a rather old flag for fzf and should work with 0.42, I would dig into it to try to figure it out but since fzf-lua is not supported on windows this would be just the first issue of many.

asmodeus812 commented 11 months ago

@ibhagwan chiming in regarding the windows support, is it not possible to have it in a very limited scope, i.e without all the multiprocess features, without file icons, all the headless spawning, just the bare bones, i suppose by default we can assume only the performance profile can be supported for windows, or have a dedicated windows profile which is going to disable most of the complex features, might just work, with some tweaking.

ibhagwan commented 11 months ago

@ibhagwan chiming in regarding the windows support, is it not possible to have it in a very limited scope, i.e without all the multiprocess features, without file icons, all the headless spawning, just the bare bones, i suppose by default we can assume only the performance profile can be supported for windows, or have a dedicated windows profile which is going to disable most of the complex features, might just work, with some tweaking.

Unfortunately that won’t be me @asmodeus812, I don’t have windows nor do I have any intention on installing a privacy abusing OS, regarding minimal support, take a look at #772.

ibhagwan commented 11 months ago

by default we can assume only the performance profile can be supported for windows

Btw @asmodeus812, even that would come with a lot of headache but if that’s the case why not use fzf.vim?

ibhagwan commented 11 months ago

Closing as I'm not planning on adding windows support.

ibhagwan commented 7 months ago

FYI, windows is now supported follow #1038 and the windows branch for more info.