The automatic hook searched the command exactly as typed, so `k get pods`
never matched `kgp='kubectl get pods'`. It now searches the alias-expanded
command zsh passes to preexec ($3). When the command started with an alias,
only aliases that cover more of the command are suggested, so typing `gst`
alone still prints nothing.
Closes#12040
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Use add-zsh-hook to add functions to hooks. That way they won't be added again
when doing `source ~/.zshrc` multiple times.
Co-authored-by: Marc Cornellà <marc.cornella@live.com>