olets / zsh-abbr

The zsh manager for auto-expanding abbreviations, inspired by fish. ~13,000 unique cloners as of May '24, 580+ Homebrew installs 6/23-6/24
https://zsh-abbr.olets.dev
Other
517 stars 18 forks source link

_zsh_abbr_command:1: command not found: command #16

Closed swrenn closed 4 years ago

swrenn commented 4 years ago

Your recent change 0311ecf added these lines to zsh-addr.zsh:

  _zsh_abbr_command() {
    \command \command $@
  }

This causes the error in the title because I don't have a binary called 'command' in my path.

olets commented 4 years ago

Thanks for the report!

command is one of the zsh builtin commands, so I would expect this to work as long as /usr/bin has not been removed from your path.

What is the output of running these two commands in your terminal?

echo $PATH

# --
# edit: probably enough to specifically check whether /usr/bin is in PATH:
typeset -a path_segments=( ${(s.:.)"$(echo $PATH)"} ) && echo $path_segments[(I)/usr/bin]

and

where command
olets commented 4 years ago

Also what system are you on? How about you @sean-brandt?

seanb4t commented 4 years ago
XXX@abyss ~
λ uname -a
Linux abyss 5.4.0-29-generic #33-Ubuntu SMP Wed Apr 29 14:32:27 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

XXX@abyss ~
λ where command
command: shell built-in command

XXX@abyss ~
λ \command \command
zsh: command not found: command

XXX@abyss ~
λ echo $ZSH_VERSION
5.8

XXX@abyss ~
λ echo $PATH |sed -e s/yyy/XXX/g
/home/XXX/.rbenv/shims:/home/XXX/.rbenv/bin:/home/XXX/.zinit/plugins/laggardkernel---git-ignore/bin:/home/XXX/.rbenv/shims:/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:/usr/local/bin:/usr/local/sbin:/home/XXX/.zinit/plugins/dandavison---delta/delta:/home/XXX/.zinit/plugins/BurntSushi---ripgrep/rg:/home/XXX/.zinit/plugins/sharkdp---bat/bat:/home/XXX/.rbenv/bin:/home/XXX/.zinit/polaris/bin:/home/XXX/anaconda3/condabin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/XXX/Code/Go/bin:/home/XXX/.dotfiles/bin:/home/XXX/bin:/home/XXX/.zinit/plugins/unixorn---git-extra-commands/bin:/home/XXX/.zinit/plugins/zpm-zsh---colorize/bin:/home/XXX/.zinit/plugins/reegnz---jq-zsh-plugin/bin:/home/XXX/.zinit/plugins/droctothorpe---kubecolor/bin:/home/XXX/.zinit/plugins/zpm-zsh---tmux/bin:/home/XXX/.zinit/plugins/unixorn---git-extra-commands/bin:/home/XXX/.zinit/plugins/zpm-zsh---colorize/bin:/home/XXX/.zinit/plugins/reegnz---jq-zsh-plugin/bin:/home/XXX/.zinit/plugins/droctothorpe---kubecolor/bin:/home/XXX/.zinit/plugins/zpm-zsh---tmux/bin
swrenn commented 4 years ago

➜ ~ uname -a
Linux pop-os 5.4.0-7626-generic #30~1588169883~20.04~bbe668a-Ubuntu SMP Wed Apr 29 21:00:02 UTC x86_64 x86_64 x86_64 GNU/Linux ➜ ~ echo $ZSH_VERSION 5.8 ➜ ~ where command command: shell built-in command ➜ ~ echo $PATH | tr : '\n' /usr/local/sbin /usr/local/bin /usr/sbin /usr/bin /sbin /bin /usr/games /usr/local/games /snap/bin [others...]

olets commented 4 years ago

Thanks. Interesting, on macOS I get

% where command
command: shell built-in command
/usr/bin/command

I'll see what I can come up with.

olets commented 4 years ago

Should be fixed in master, let me know. Can cut a release for package manager users tomorrow

swrenn commented 4 years ago

I just pulled and tested. No errors.

P.S. Thanks for building this extension.

olets commented 4 years ago

Released in 3.3.1, and now I have a Linux testing setup so hope to catch little platform differences like this going forward.

Glad you find it useful!

EDIT 2024: this issue still gets some traffic. Maybe it's just bots and scrapers. If you are a human and get this bug still, please let me know.

olets commented 2 months ago

Belatedly acknowledging more contributors in https://github.com/olets/zsh-abbr#community and https://zsh-abbr.olets.dev/community/

Would you like to be added @swrenn ? If so, I'll have the all-contributors bot open a pull request. Then I'll tag you in it to review for correct info

olets commented 2 months ago

same for @seanb4t