Add support for partial shell completion options like in Path
When tab completing a path on the shell, the options only display a part and ommit the prefix path, making it much easier to read. I.e. completing "/home/user" will offer
Documents Downloads Pictures
rather than
/home/user/Documents /home/user/Downloads /home/user/Pictures
While click already supports this for paths, it would be nice if a similar feature would be implemented for custom parameters (i.e. comma separated values).
Hi, I'd like to try implementing this feature. Can I be assigned to this issue?
It's the shell (bash, zsh, fish, etc) itself that is handling how to show completions. Click sends a special signal to the completer script that it's a file path, and the shell does the rest. Otherwise, the only thing we can send to the shell is the full completion value.
I don't think there's anything to do here on the Click level. There may be an option in a specific shell's completion system. However, it's already possible to write your own completer to use your personal preference in that case.
Reopening to add info for docs. Need an FAQ. A fair amount of requests seem to not know what is done by click vs shell.