Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not complete docker commands after alias with grc #6954

Closed
joeky888 opened this issue Jun 28, 2018 · 1 comment
Closed

Can not complete docker commands after alias with grc #6954

joeky888 opened this issue Jun 28, 2018 · 1 comment
Labels
Support Request for support Topic: alias Pull Request or issue regarding aliases

Comments

@joeky888
Copy link

Can not get docker completion work after alias with grc.

$ alias docker='grc -es --colour=auto /usr/bin/docker'
$ docker <tab> # Not working anymore

Any ideas? thanks.

@ghost ghost added the Bug Something isn't working label Jun 28, 2018
@mcornella mcornella added Topic: alias Pull Request or issue regarding aliases question and removed Bug Something isn't working labels Jun 28, 2018
@mcornella
Copy link
Member

You should specify that you want to use docker completions with the docker alias with compdef _docker docker. But you have to also run setopt completealiases to disable zsh's behavior of looking at the alias definition to know which completion function to run (in your case, it would try to find completions for the grc command).

Enabling this option will mess up the rest of aliases that don't have an explicit completion defined, so here's a better option: use a function instead of an alias, like so:

function docker { grc -es --colour=auto /usr/bin/docker "$@" }
compdef _docker docker

@mcornella mcornella added Support Request for support and removed Type: question labels Mar 25, 2019
hjpotter92 added a commit to hjpotter92/grc that referenced this issue Dec 28, 2020
More description available on github thread:
ohmyzsh/ohmyzsh#6954

Signed-off-by: hjpotter92 <hjpotter92+github@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Support Request for support Topic: alias Pull Request or issue regarding aliases
Projects
None yet
Development

No branches or pull requests

2 participants