MichaelAquilina / zsh-you-should-use

📎 ZSH plugin that reminds you to use existing aliases for commands you just typed
GNU General Public License v3.0
1.41k stars 44 forks source link

Not useful when aliased to 'command <command>' #108

Closed tddschn closed 3 years ago

tddschn commented 3 years ago

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?

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.

MichaelAquilina commented 3 years ago

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?

tddschn commented 3 years ago

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.