0

I'm trying to add zsh completions for some aliases which are prefixed by a command and some args. More specifically, I have some commands which are aliased to an envchain ENV_NAME prefix.

For example:

alias brew='envchain homebrew-credentials brew' 

What I'm trying to achieve is having completions for brew command.

What I've been able to do so far is set compdef _precommand envchain, but it doesn't work because envchain takes an argument before the actual command.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Calin Don
  • 865
  • 2
  • 11
  • 19
  • Command completion occurs before the alias is expanded. It's the string `brew` itself that is relevant, not what it will expand to after you hit enter. (If you use something to expand the alias "in-line" before hitting Enter, then you'll have to worry about defining command completion for `envchain`.) – chepner May 10 '23 at 20:45

0 Answers0