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.52k stars 44 forks source link

not working with `sudo` #136

Open davidavn opened 3 months ago

davidavn commented 3 months ago

Issue Details

Please provide the following details when opening an issue:

The plugin does not suggest aliases when typing a sudo command

Operating System (uname -a)

Linux L1800101964 5.15.153.1-microsoft-standard-WSL2 #1 SMP Fri Mar 29 23:14:13 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

zsh version (zsh --version)

zsh 5.8.1 (x86_64-ubuntu-linux-gnu)

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

1.8.0

How is zsh-you-should-use installed?

Steps to reproduce the issue

❯ git version
Found existing alias for "git". You should use: "g"
git version 2.34.1
❯ sudo git version
git version 2.34.1

gist link to your zshrc

dont think its relevant, standard oh -my-zsh

MichaelAquilina commented 3 months ago

I opened an experimental branch to fix this issue if you want to check it out #137

davidavn commented 3 months ago

looks like it work:

❯ git status
Found existing alias for "git status". You should use: "gst"
fatal: not a git repository (or any of the parent directories): .git
❯ sudo git status
Found existing alias for "git status". You should use: "gst"
fatal: not a git repository (or any of the parent directories): .git