zdharma-continuum / zinit

🌻 Flexible and fast ZSH plugin manager
MIT License
2.95k stars 126 forks source link

sbin annex does not work with zsh 5.4.2 #41

Closed cgjosephlee closed 2 years ago

cgjosephlee commented 2 years ago

Describe the bug A clear and concise description of what the bug is.

sbin did not create any shim in corresponding directory. But when I delete the package, zinit warns that

bin-gem-node annex: The fzf shim didn't exist in $ZPFX/bin (or isn't a regular file)

Zinit config Steps to reproduce the behavior. Please include any relevant config section that may help the maintainers reproduce the issue.

zinit light-mode for \
    zdharma-continuum/z-a-rust \
    zdharma-continuum/z-a-patch-dl \
    zdharma-continuum/z-a-as-monitor \
    zdharma-continuum/z-a-bin-gem-node

zinit wait lucid from"gh-r" as"null" for \
    sbin"fzf" @junegunn/fzf \
    sbin"**/fd" @sharkdp/fd \
    sbin"**/bat" @sharkdp/bat \
    sbin"**/exa" @ogham/exa

Expected behavior A clear and concise description of what you expected to happen.

Screenshots (optional) If applicable, add screenshots to help explain your problem.

Versions:

Additional context Add any other context about the problem here.

pschmitt commented 2 years ago

I can reproduce your issue with the following script:

#!/usr/bin/env bash

create_config() {
  local tempfile
  tempfile=$(mktemp)

  trap 'rm -f $tempfile' EXIT INT
cat << EOM > "$tempfile"
  zinit light-mode for \
      zdharma-continuum/z-a-rust \
      zdharma-continuum/z-a-patch-dl \
      zdharma-continuum/z-a-as-monitor \
      zdharma-continuum/z-a-bin-gem-node

  zinit wait lucid from"gh-r" as"null" for \
      sbin"fzf" @junegunn/fzf \
      sbin"**/fd" @sharkdp/fd \
      sbin"**/bat" @sharkdp/bat \
      sbin"**/exa" @ogham/exa
EOM
  echo "$tempfile"
}

if [[ "${BASH_SOURCE[0]}" == "${0}" ]]
then
  INIT_CONFIG=$(create_config)

  docker run -it --rm -v "${INIT_CONFIG}:/init.zsh" ghcr.io/pschmitt/zinit:zsh-5.4.2-latest
fi

Will look into it.

pschmitt commented 2 years ago

For fzf you can at least use the zinit-package:

zinit pack"binary+keys" for fzf

There are some issues with the bin-gem-node annex though, that's for sure.

cgjosephlee commented 2 years ago

Thank you for investigating this. For now I use as"program" ice and pretend that I cannot see my terrifying $path. lol

pschmitt commented 2 years ago

This issue seems to only be happening with older zsh versions. Using the snippet above and setting the ZSH version to 5.5.1 (tag: zsh-5.5.1) the shims get created as expected.

pschmitt commented 2 years ago
zinit pack"5.8" for zsh

😇

cgjosephlee commented 2 years ago

Okay... So it's a zsh version problem... I mostly work on remote server where I don't have root privilege. I think I can only give up on this fantastic feature for now. Thank you.

pschmitt commented 2 years ago

To reduce the number of dirs in your PATH you can also want to give z-a-linkbin a try: https://github.com/NICHOLAS85/z-a-linkbin

cgjosephlee commented 2 years ago

It works! Tested with zsh-v5.4.2 from ubuntu 18.04 and zsh-v5.1.1 from ubuntu 16.04.