[ZSH] Plugin aliases break completion for the command run by the plugin
I have ZSH set up to introspect aliases and run plugin functions based on what the alias is calling.
This means that an alias set up for gh: alias gh='op plugin run -- gh' will actually trigger the _op_plugin_run completion function, not that for gh itself.
I have worked around this with this in my .zshrc (I don't really want to edit the completion file as I'll definitely forget to keep it updated):
```
function __my_op_plugin_run() {
_op_plugin_run
for ((i = 2; i < CURRENT; i++)); do
if [[ ${words} == -- ]]; then
shift $i words
((CURRENT -= i))
_normal
return
fi
done
}
function load_op_completion() {
completion_function="$(op completion zsh)"
sed -E 's/^( +)_op_plugin_run/\1my_op_plugin_run/' <<<"${completion_function}"
}
eval "$(__load_op_completion)"
compdef _op op
```
In lay-terms, this:
1. Checks if the previous word is --
2. Takes -- and everything prior to it out of the scope of the completion
3. completes as normal from the first argument after --.
This is the pattern used by https://github.com/99designs/aws-vault/blob/master/contrib/completions/zsh/aws-vault.zsh
This is also possible in https://github.com/99designs/aws-vault/blob/master/contrib/completions/bash/aws-vault.bash and https://github.com/99designs/aws-vault/blob/master/contrib/completions/fish/aws-vault.fish
It would be really helpful if the CLI team could update the completion function generated by op completion $SHELL to trigger this reset, so we don't lose shell functionality by using op plugins!
1Password Version: Not Provided
Extension Version: Not Provided
OS Version: Not Provided
Browser:_ Not Provided
