junegunn / fzf

:cherry_blossom: A command-line fuzzy finder
https://junegunn.github.io/fzf/
MIT License
63.4k stars 2.36k forks source link

`printenv bash: warning: programmable_completion: printenv: possible retry loop` when attempting to tab-complete #3712

Closed carschandler closed 4 months ago

carschandler commented 4 months ago

Checklist

Output of fzf --version

0.47.0 (0.47.0)

OS

Shell

Problem / Steps to reproduce

Type printenv P and press TAB. Usually bash will trigger autocompletion for all environment variables starting with P, but fzf is causing it to throw:

bash: warning: programmable_completion: printenv: possible retry loop

I'm using NixOS and home-manager to manage my fzf install, and when I set enableBashIntegration to false, which prevents the bash completion files from being linked, the error goes away.

junegunn commented 4 months ago

Please test if the problem is reproducible with the latest version, 0.49.0.

carschandler commented 4 months ago

It will take some time until I can test on 0.49.0, but I also discovered that the issue occurs after export, i.e. export PATH=$PA<tab>, so it seems to have something to do with completions being fetched for environment variables.

junegunn commented 4 months ago

It will take some time until I can test on 0.49.0

You can just download the binary from https://github.com/junegunn/fzf/releases/tag/0.49.0 and run eval "$(./downloaded-fzf --bash)"

junegunn commented 4 months ago

Likely a duplicate of #3674, and I can't reproduce it with the latest version of 0.49.0. Please reopen if you still have the problem after upgrading fzf.