MichaelAquilina/zsh-you-should-use

Not useful when aliased to 'command <command>'

tddschn opened this issue · 2 comments

Issue Details

To avoid aliasing based on other aliases, most of my zsh aliases are aliased to 'command ' like
alias ls='command ls' and alias g='command git'. (command is a zsh builtin.)
zsh-you-should-use doesn't work well with these aliases.

For example,
I have cmd='command' and sas='command SwitchAudioSource ' in my aliases:
image

Please provide the following details when opening an issue:

Operating System (uname -a)

Darwin me 19.6.0 Darwin Kernel Version 19.6.0: Mon Aug 31 22:12:52 PDT 2020; root:xnu-6153.141.2~1/RELEASE_X86_64 x86_64 i386 MyMacBook Darwin

(macOS Catalina 10.15.7)

zsh version (zsh --version)

zsh 5.8 (x86_64-apple-darwin19.3.0)

you-should-use version (echo "$YSU_VERSION")

1.7.3

How is zsh-you-should-use installed?

  • zplug
  • oh-my-zsh
  • Antigen
  • Other (please specify)

Steps to reproduce the issue

unalias git && alias g='command git'
git

gist link to your zshrc

My zshrc is not useful for this issue.

First time I've heard of the command builtin to be honest. Seems like command should be treated as not being there when it comes to determining aliases from what I understand?

Yeah I agree it's not a very popular builtin. :)

Very few people use command in their aliases but sometimes it's good to use it to avoid aliasing based on another alias or a user-defined function that happen to have the same name with the actual command.

I don't think there's a good way to fix issues with this edge case and I don't think I need it now. :)

I'll close this issue.