Closed dec0dOS closed 1 year ago
good catch on this, thank you for reporting
Mind sharing your config (do not see any public config in your repos)?
Are consistently seeing this issue?
If yes, have you ran:
zi self-update
regardless, i'll try to reproduce it in zunit tests to improve confidence in future changes.
currently, the majority of current tests are for ices. will try to get this fixed ASAP.
Thanks for your fast and detailed response, @vladdoster!
zinit self-update
command does not fix the issue.
see if its resolved when you run:
exec zsh -l
or
exec zsh -il
finally, a hail mary (also genuine bug triage)
zi delete --all --yes \
&& unset $_comp \
&& exec zsh -l
The same error persists with the first two commands. The third one does not work as expected
Here is my trimmed version of .zshrc
:
# If not running interactively, don't do anything
[[ -o interactive ]] || return
## ----------------------------------------
## Prompt
## - Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
## - Initialization code that may require console input (password prompts, [y/n]
## confirmations, etc.) must go above this block; everything else may go below
## ----------------------------------------
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
## ----------------------------------------
## Env
## ----------------------------------------
export SAVEHIST=0
export CLICOLOR=1
export ENHANCD_FILTER=fzf
export TERM=xterm-256color
export BAT_THEME="ansi"
export HOMEBREW_NO_COMPAT=1
export HOMEBREW_NO_ENV_HINTS=1
export HOMEBREW_NO_ANALYTICS=1
export HOMEBREW_NO_AUTO_UPDATE=1
export DOTNET_CLI_TELEMETRY_OPTOUT=1
export PYTHONSTARTUP=~/.pythonrc
export NODE_REPL_HISTORY=""
export PATH="$PATH:/Users/alex/.local/bin"
## ----------------------------------------
## Editor
## ----------------------------------------
export EDITOR=nvim
export GIT_EDITOR="${EDITOR}"
export SVN_EDITOR="${EDITOR}"
## ----------------------------------------
## Language
## ----------------------------------------
export LANGUAGE="en_US.UTF-8"
export LANG="${LANGUAGE}"
export LC_ALL="${LANGUAGE}"
export LC_CTYPE="${LANGUAGE}"
## ----------------------------------------
## Option & Function
## ----------------------------------------
bindkey -e
setopt no_beep
setopt nolistbeep
setopt auto_cd
setopt auto_list
setopt auto_menu
setopt auto_param_keys
setopt auto_param_slash
setopt auto_pushd
setopt complete_aliases
setopt correct
setopt equals
setopt extended_glob
setopt list_packed
setopt list_types
setopt mark_dirs
setopt magic_equal_subst
setopt no_hup
setopt prompt_subst
setopt auto_remove_slash
## ----------------------------------------
## iTerm2
## ----------------------------------------
if [ "$TERM_PROGRAM" = "iTerm.app" ]; then
[ -f ~/.iterm2_shell_integration.zsh ] && source ~/.iterm2_shell_integration.zsh
fi
## ----------------------------------------
## Homebrew
## ----------------------------------------
if type brew &>/dev/null
then
FPATH="$(brew --prefix)/share/zsh/site-functions:${FPATH}"
autoload -Uz compinit
compinit
fi
## ----------------------------------------
## Zinit
## ----------------------------------------
source $(brew --prefix)/opt/zinit/zinit.zsh
autoload -Uz _zinit
(( ${+_comps} )) && _comps[zinit]=_zinit
zinit wait lucid for \
atinit"ZINIT[COMPINIT_OPTS]=-C; zicompinit; zicdreplay" \
zdharma-continuum/fast-syntax-highlighting \
blockf \
zsh-users/zsh-completions \
atload"!_zsh_autosuggest_start" \
zsh-users/zsh-autosuggestions
zinit ice wait'0'
zinit wait lucid is-snippet as"completion" for \
OMZP::docker/_docker \
OMZP::docker-compose/_docker-compose \
OMZP::yarn/_yarn
## ----------------------------------------
## Misc settings
## ----------------------------------------
zstyle ':completion:*:(ssh):*' hosts $hosts
zstyle ':completion:*:(ssh):*' users $users
### Added by Zinit's installer
if [[ ! -f $HOME/.local/share/zinit/zinit.git/zinit.zsh ]]; then
print -P "%F{33} %F{220}Installing %F{33}ZDHARMA-CONTINUUM%F{220} Initiative Plugin Manager (%F{33}zdharma-continuum/zinit%F{220})…%f"
command mkdir -p "$HOME/.local/share/zinit" && command chmod g-rwX "$HOME/.local/share/zinit"
command git clone https://github.com/zdharma-continuum/zinit "$HOME/.local/share/zinit/zinit.git" && \
print -P "%F{33} %F{34}Installation successful.%f%b" || \
print -P "%F{160} The clone has failed.%f%b"
fi
source "$HOME/.local/share/zinit/zinit.git/zinit.zsh"
autoload -Uz _zinit
(( ${+_comps} )) && _comps[zinit]=_zinit
## ----------------------------------------
## Prompt
## - Must be the end of .zshrc.
## - To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
## ----------------------------------------
zinit ice depth=1
zinit light romkatv/powerlevel10k
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
If anything is wrong with my .zshrc
, I would be grateful for any suggestions.
The same error persists with the first two commands. The third one does not work as expected
Doh, I forgot the s
in _comps
!
zi delete --all --yes \
&& unset _comps \
&& exec zsh -l
I'm perplexed why you source zinit.zsh
in two separate places.
It looks like a Zinit install via Brew. I assume the formulae run the installer script, which added the second set of setup steps.
Am I correct in this assumption?
# ----------------------------------------
# Zinit
# ----------------------------------------
source $(brew --prefix)/opt/zinit/zinit.zsh
autoload -Uz _zinit
(( ${+_comps} )) && _comps[zinit]=_zinit
zinit wait lucid for \
atinit"ZINIT[COMPINIT_OPTS]=-C; zicompinit; zicdreplay" \
zdharma-continuum/fast-syntax-highlighting \
blockf \
zsh-users/zsh-completions \
atload"!_zsh_autosuggest_start" \
zsh-users/zsh-autosuggestions
zinit ice wait'0'
zinit wait lucid is-snippet as"completion" for \
OMZP::docker/_docker \
OMZP::docker-compose/_docker-compose \
OMZP::yarn/_yarn
wait
ice can not be used with the for
syntax.zinit wait lucid is-snippet as"completion" for \
OMZP::docker/_docker \
OMZP::docker-compose/_docker-compose \
OMZP::yarn/_yarn
zinit ice wait'0'
should be removed. The snippet might create a race condition of sorts causing the reported error.My other hypothesis is that the two zinit locations are out of sync, but variables are getting twisted. Thus causing one version to try to refer to various things in a different version? I forget if zinit looks for the zinit repo in HOMEBREW or if it sets env variables.
I'll get back to you on this.
Not sure if that makes sense, but... yeah.
### Added by Zinit's installer
if [[ ! -f $HOME/.local/share/zinit/zinit.git/zinit.zsh ]]; then
print -P "%F{33} %F{220}Installing %F{33}ZDHARMA-CONTINUUM%F{220} Initiative Plugin Manager (%F{33}zdharma-continuum/zinit%F{220})…%f"
command mkdir -p "$HOME/.local/share/zinit" && command chmod g-rwX "$HOME/.local/share/zinit"
command git clone https://github.com/zdharma-continuum/zinit "$HOME/.local/share/zinit/zinit.git" && \
print -P "%F{33} %F{34}Installation successful.%f%b" || \
print -P "%F{160} The clone has failed.%f%b"
fi
source "$HOME/.local/share/zinit/zinit.git/zinit.zsh"
autoload -Uz _zinit
(( ${+_comps} )) && _comps[zinit]=_zinit
Oh, I'm dumb. I didn't realize the logs showed the homebrew path.
IMO, don't manage zinit with Brew. I am a die-hard Homebrew user, but it doesn't warrant nor leverage any of Brew's features. Furthermore, the formulae have no HEAD defined, so I think you're stuck on v3.7
since the release doesn't bundle the .git/
directory.
Thanks a lot, @vladdoster!
Seems that the problem was with the brew installation and the incorrent .zshrc
configuration. I've followed all your recommendadtions above and it is working as expected now.
It was working great for a long time, so I didn't borther some mistakes that was made priviously in the .zshrc.
Regarding the brew formula - if you does not recommend the bunduled version, may be it should be updated to install from HEAD by default or deperecated to remove the confusion?
Buy the way, event after installing the zinit from HEAD (brew uninstall zinit && brew install --force --HEAD --fetch-HEAD zinit
) currently there are some new issues with the zinit.
@dec0dOS, I just cut release v3.8.0
.
If you run:
brew uninstall --force zinit && brew install --force --HEAD --fetch-HEAD zinit
should now include all the latest changes!
What happened?
Please check the
Relevant output
sectionSeems that the following commit is relevant
Steps to reproduce
zinit update
Relevant output
Screenshots and recordings
No response
Operating System & Version
OS: darwin22.0 | Vendor: apple | Machine: x86_64 | CPU: arm64 | Processor: arm | Hardware: arm64
Zsh version
zsh 5.9 (arm-apple-darwin21.3.0)
Terminal emulator
xterm-256color
If using WSL on Windows, which version of WSL
No response
Additional context
No response
Code of Conduct