cobra
cobra copied to clipboard
Allow overwriting the type of tab complete in powershell with a environment variable to support alterative completion providers
I initially made this issue under chezmoi, but was told I should make it in the upstream cobra repo instead.
https://github.com/twpayne/chezmoi/issues/4251
Currently tab completion in PowerShell just looks up the what name of the function that is providing the completion. However, if a non standard function is used the completions default to the least detailed option. For example, if one was to use the PSFzf tab completion which uses fzf to display a preview of the different options like the 'MenuComplete' function then instead of seeing the description it won't show anything. Would it be possible to add a check to see if an environment variable has been set, something like chezmoi_completion_mode, and if so use that to determine the mode? Then in the event that it is not set default back to using the name of the function.