zdharma-continuum / zinit

🌻 Flexible and fast ZSH plugin manager
MIT License
2.74k stars 122 forks source link

[bug]: Fallback command for ZINIT[LIST_COMMAND] is invalid #544

Open yyykt opened 12 months ago

yyykt commented 12 months ago

What happened?

zinit snippets does not work with following error.

> zinit snippets
No `tree' program, it is required by the subcommand `ls'
Download from: http://mama.indstate.edu/users/ice/tree/
It is also available probably in all distributions and Homebrew, as package `tree'
ls: unrecognized option '--tree'
Try 'ls --help' for more information.
, located at ZINIT[SNIPPETS_DIR], i.e. /home/yu/.local/share/zinit/snippets

Steps to reproduce

run zinit snipptes in a environment where exa nor tree available.

Relevant output

No response

Screenshots and recordings

No response

Operating System & Version

arch linux

Zsh version

zsh 5.9 (x86_64-pc-linux-gnu)

Terminal emulator

alacritty

If using WSL on Windows, which version of WSL

None

Additional context

It appears that 'ls --tree' is being used as a fallback command for ZINIT[LIST_COMMAND] when neither the 'exa' nor 'tree' command is available. However, this option is invalid and does not function as a fallback.

https://github.com/zdharma-continuum/zinit/blob/1cb1df630787a28234e6310bd66fe8aa7f432663/zinit.zsh#L65-L73

Code of Conduct