-
Notifications
You must be signed in to change notification settings - Fork 151
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
Feature: allow fzf-lua to clear some env vars used by fzf, ripgrep, fd, ... #1266
Comments
I’m unsure what to make of Ripgrep is different though, I think it’s worth considering temporary removal (by setting it in -/ null in the fzf spawn env). |
Yeah, I wouldn't do that by default for sure, but just have an option to be able not to use FZF_DEFAULT_OPTS. For ripgrep it might indeed make sense to ignore its vars by default. |
The real issue is users that just add stuff to their shell, but have no idea what it does. So for those users, it actually does make sense to not use existing env vars, so I'd for sure enable that option in LazyVim 😅, but also document it so that advanced users can still opt out. |
I tend to agree.
l would like to give my users more credit, nevertheless your point is well made lol.
But how will we differentiate the users who copy pasted willy nilly? They’d still have to open an issue and then have to enable the How many cases like that exist that create bugs? I don’t think it’s too many as most opts are overwritten by fzf-lua anyways. So far I’ve seen only one which I’ve tackled in #1107: Lines 281 to 295 in ad4d70b
|
Fair point... :) Then maybe just the ripgrep one for now. |
Alright I’ll handle it later when not AFK, unless it’s urgent for you, I can merge a PR adding: ["RIPGREP_CONFIG_PATH"] = '', to the fzf process env vars: Lines 277 to 280 in ad4d70b
|
No, not urgent at all :) Btw, I started working on a Very annoying... A simple healthcheck that checks for tool deps and warns when |
Oh wow that’s a great idea too, ty @folke! hopefully the upstream is fixed soon or I’ll take a stab at hacking it. P.S. hope you did well on your sailing exam, I’d feel personally partially responsible if it’s due to neovim lo |
I'm a bit late to the party, but I'd still like to share my two cents :) I've experienced this in LazyVim/LazyVim#3656 (comment) because I set the option quite a long time ago and I couldn't possibly remember. Another "solution" to this, is to explicitly override the conflicting options, which The benefit to this is that you can still respect the user's config, working in conjuction with fzf-lua's I hope my comment doesn't give the impression that I'm trying to shove the responsibility to you, while this is clearly a user's (me) fault. Thank you both for responding and resolving this so quickly. |
That was mainly the reasoning behind keeping FZF_DEFAULT_OPTS, but IMHO this doesn’t apply to ripgrep, unlike bat which has a color scheme and layout preferences ripgrep in fzf-lua requires a specific format which can conflict with such options (as you experienced) so I’m having a hard time justifying why to keep ripgrep config var. Can you provide a use case why it would be valuable to keep this var in thru context of fzf-lua.grep? |
I think there are a few cases but at the same time they don't affect me too much to make a strong argument. I've been using the latest implentation and I'm happy with it. The flags I've seen used mostly are |
IMHO this just strengthened the case for nullifying the ripgrep options, search options should be controlled by fzf-lua only ( |
Perfect, I cannot think of other options on top of my head; solid case for nullifying then! |
Thanks for keeping us in the loop! |
Have you RTFM'd?
Feature Request
I've seen some obscure issues with fzf-lua that in the end were the result of the user having set an env var related to one of the tools used in fzf-lua.
One way to solve this on the LazyVim side, is to simply unset those variables, but that's not ideal, since then the env vars would also have been reset when using a regular terminal inside Neovim.
Better would be to simply not pass a given list to the shell commands using a setting.
Although, now that I think about it, I'm not even sure that will always work as expected. Probably depends on the shell and if it will source init files and as such re-populate the env again.
Possibly offending env vars:
Any ideas?
Related: LazyVim/LazyVim#3656 (reply in thread)
The text was updated successfully, but these errors were encountered: