I think fish does this? I know it gives me branch names as completion options sometimes, idk how aware it is of the specific flags.
fish is a bit insonsistent on it. For instance, `git add <tab>` will only autocomplete for modified files. It will also fill in wildcards, e.g. `cat *.txt <tab>` will expand to show all .txt files. On the failure side, `rm foo <tab>` will still show `foo` as an option.
IME, zsh has better autocompletion (which, at the time at least, was a separate install).
All shells do. Even alternate shells like Murex and Nushell.
The problem isn’t that they can’t, it’s that writing context aware shell completions is hard because every tool does things slightly differently, and typically completions are not done by the same people who wrote the CLI tool to begin with.
So you end up with a thousand edge cases where stuff isn’t 100% correct.