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

Bug: [windows] searching for " turns into ^"break^" #1193

Closed
3 of 6 tasks
TheLeoP opened this issue May 13, 2024 · 4 comments
Closed
3 of 6 tasks

Bug: [windows] searching for " turns into ^"break^" #1193

TheLeoP opened this issue May 13, 2024 · 4 comments
Labels
upstream An issue upstream (neovim, fzf, etc) Windows Windows OS

Comments

@TheLeoP
Copy link
Contributor

TheLeoP commented May 13, 2024

RTFM Checklist

  • I have searched exisiting issues / discussions
  • I have read the Wiki including the Advanced section
  • I have read man fzf / I am well versed in shell fzf

Operating system

Windows 11 23H2

Shell

powershell

Neovim version (nvim --version)

NVIM v0.10.0-dev-3100+gd3fa88b70

Fzf version (fzf --version)

0.52.0 (bcda25a)

Output of :lua print(os.getenv('FZF_DEFAULT_OPTS'))

nil

Is the problem reproducible with mini.sh?

  • My issue is reproducible with mini.sh
  • My issue IS NOT reproducible with mini.sh
  • I have not tested with mini.sh (not relevant, requires LSP, Windows, etc)

Fzf-lua configuration

require('fzf-lua').setup({})

Describe the bug / steps to reproduce

  1. FzfLua live_grep debug=true
  2. Type a single " into the prompt
  3. FzfLua shows that the command being executed is rg --column --line-number --no-heading --color=always --smart-case --max-columns=4096 -e ^"break^" (the important part being ^"break^")

Note: if a second " is typed, the escaping works as expected (i.e., rg searchs for "" by receiving -e ^"\^"\^"^")

@TheLeoP TheLeoP added the bug Something isn't working label May 13, 2024
@ibhagwan
Copy link
Owner

ibhagwan commented May 13, 2024

I noticed that too, this was introduced with the new windows escaping logic in fzf 0.51, I haven’t had the chance to explore that enough to determine if this is a bug in fzf or fzf-lua, if you downgrade to 0.49 it will work as expected.

I will look deeper into this when I get a chance.

@ibhagwan ibhagwan added upstream An issue upstream (neovim, fzf, etc) and removed bug Something isn't working labels May 13, 2024
@ibhagwan
Copy link
Owner

@TheLeoP, this is an upstream issue, while I can remove functionality to make this work (do not display regex error messages / silent fail) I'd rather this be addressed properly by the upstream.

ref: junegunn/fzf#3789

@ibhagwan
Copy link
Owner

@TheLeoP, updated https://github.com/ibhagwan/fzf-lua/blob/main/README-Win.md, it is recommended to use fzf 0.50.0 until the upstream is resolved.

In the meantime if you wish to remain with 0.52 b64d280 further adjusts for other changes in the new escaping added with 0.51/0.52 which helps the issue a bit, you can now search for " if you run:

:FzfLua live_grep exec_empty_query=true silent_fail=false stderr_to_stdout=false

Note that the above will still have oddities (described in junegunn/fzf#3789 (comment)) due to the wrong escape sequence.

@ibhagwan
Copy link
Owner

@TheLeoP, everything should work after you update fzf to 0.52.1.

Also recommended to update fzf-lua to 3131cb4.

Lmk if otherwise?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream An issue upstream (neovim, fzf, etc) Windows Windows OS
Projects
None yet
Development

No branches or pull requests

2 participants