Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't use :FZF --expect=! from neovim on windows #3620

Closed
4 of 11 tasks
adigitoleo opened this issue Feb 10, 2024 · 8 comments
Closed
4 of 11 tasks

Can't use :FZF --expect=! from neovim on windows #3620

adigitoleo opened this issue Feb 10, 2024 · 8 comments
Labels

Comments

@adigitoleo
Copy link

  • I have read through the manual page (man fzf)
  • I have the latest version of fzf
  • I have searched through the existing issues

Info

  • OS
    • Linux
    • Mac OS X
    • Windows
    • Etc.
  • Shell
    • bash
    • zsh
    • fish
    • pwsh.exe (PowerShell 7.4.1)

Problem / Steps to reproduce

  • Install fzf on Windows 11 Home 23H2 using winget install --id junegunn.fzf
  • Launch PowerShell 7.4.1 (current version available on winget)
  • Launch neovim 0.9.5 (also on winget) with nvim -u NORC
  • Run :FZF --expect=!

On Linux, this works as expected (when ! is pressed, :FZF exits and opens the selected entry). On windows, using the above setup, fzf exits with an error:

key names required

This must come from fzf#run, the low-level interface used for the :FZF command.

@adigitoleo adigitoleo changed the title Can't use :FZF --expect='!' from neovim on windows Can't use :FZF --expect=! from neovim on windows Feb 10, 2024
@junegunn
Copy link
Owner

Seems like an escaping issue. Does fzf --expect=! work on PowerShell?

@adigitoleo
Copy link
Author

Yes, it works in PowerShell, but not inside neovim.

@junegunn
Copy link
Owner

Can you check if :call fzf#run({'options': '--expect=!'}) works?

@adigitoleo
Copy link
Author

No, that doesn't work. This was my original use case since I have a wrapper around fzf#run in my vimrc. The command fails and briefly displays "key names required" as the error message.

@junegunn
Copy link
Owner

I don't have a Windows PC to test it now. Does #3189 help in your case?

@adigitoleo
Copy link
Author

Unfortunately that patch does not fix the issue. Same error.

I tried a few variants with different kinds of escaping e.g. --expect=\! and the like but no luck. Apparently ! is a boolean NOT operator in pwsh, but I couldn't find out exactly why it isn't getting escaped properly. To be more specific about the use case, I have this as an expected key so that (in linux) pressing ! selects the current match and appends ! allowing me to conveniently run vim shebang commands like :make!. It's only a minor inconvenience that this doesn't work, but I thought I should report it anyway.

@junegunn
Copy link
Owner

junegunn commented May 1, 2024

835d2fb should fix the problem. Let me know if it doesn't work for you.

@adigitoleo
Copy link
Author

adigitoleo commented May 3, 2024

Thanks, this is indeed fixed for me on fzf 0.51.0 (PowerShell 7.4.2).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants