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
[Windows] backslash characters are double escaped indiscriminately in field index expressions #3626
Comments
Thanks for the report. I'm not a Windows user so I'm basically clueless on the matter. The escaping code is here: Lines 23 to 45 in 2616cbb
and it was from #2641. |
Gotcha, I ain’t a windows expert either (nor do I want to be lol) but I was somehow dragged into making fzf-lua support windows, while doing so I came up with what I believe is the correct escaping sequence for cmd.exe on windows, if this is of interest to you I can share my findings/reasoning/code. As for this issue, it isn’t high priority as this only affects fzf-lua’s “native” commands (I.e. piping the shell command directly to fzf), the problem isn’t found in the non-native commands as I use a neovim headless wrapper to run the command inside which fixes the escaping with lua code. |
Fixed in 0.51.0. |
man fzf
)Info
Problem / Steps to reproduce
While using fzf as a selector for rg I am unable to find a way to send special regex characters since every backslash is doubled, for example, consider the following command:
Now say I would like to search for open bracket which is a special regex character, I would need to pass
\[
to rg, but typing\[
results in the error:Another inconsistency I found is if you wish to pass
^
to rg this way you need double up the carets as it’s a special windows escape character, while this makes sense I believe it can be better handled on fzf’s side to provide consistency with other platforms.During the porting of fzf-lua for windows I also encountered other windows escaping woes (and I also believe I have the solution) for which I’ll open new issues once I have easy reproduction steps.
The text was updated successfully, but these errors were encountered: