cobra icon indicating copy to clipboard operation
cobra copied to clipboard

Allow overwriting the type of tab complete in powershell with a environment variable to support alterative completion providers

Open Nova38 opened this issue 1 week ago • 2 comments

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.

Nova38 avatar Feb 10 '25 02:02 Nova38