Closed arielsalvo closed 11 months ago
Seeing the same in a similar environment (Windows 11, WSL2, Ubuntu 22.04, zsh 5.8.1), but with more plugins installed.
❯ zi plugins
==> Plugins
.zinit-list-plugins:18: bad math expression: illegal character: "
U %/home/ririshi/.zinit/bin
.zinit-list-plugins:18: bad math expression: illegal character: "
U jessarcher/zsh-artisan
.zinit-list-plugins:18: bad math expression: illegal character: "
U romkatv/powerlevel10k
.zinit-list-plugins:18: bad math expression: illegal character: "
U zdharma-continuum/fast-syntax-highlighting
.zinit-list-plugins:18: bad math expression: illegal character: "
U zdharma-continuum/zinit-annex-bin-gem-node
.zinit-list-plugins:18: bad math expression: illegal character: "
U zdharma-continuum/zinit-annex-patch-dl
.zinit-list-plugins:18: bad math expression: illegal character: "
U zdharma-continuum/zinit-annex-readurl
.zinit-list-plugins:18: bad math expression: illegal character: "
U zdharma-continuum/zinit-annex-rust
.zinit-list-plugins:18: bad math expression: illegal character: "
U zsh-users/zsh-autosuggestions
.zinit-list-plugins:18: bad math expression: illegal character: "
U zsh-users/zsh-completions
I think there are some extra double quotes that are not correct inside (( ))
in zinit-autoload.zsh#L1567:
(( "ZINIT[STATES__$i]" )) && is_loaded="{happy}L"
The above (current) version produces the error. It works fine after changing it to this:
(( ZINIT[STATES__$i] )) && is_loaded="{happy}L"
@Ririshi @arielsalvo,
Good catch. I wonder why this issue doesn't occur on macOS...?
If you have time, please test the bug fix via branch 545-bug-bad-math-expression-in-zinit-plugins-on-ubuntu-2204wsl2
@vladdoster @pschmitt what happened with this change on the main branch? It looks like there was a merge, then an attempted revert, but instead origin/main
was hard reset ❔ Because I pulled from origin in between, my local main
branch now diverged from origin and it appears that this also ended up in another branch (origin/fix/handle-bsd-realpath
)
I know how to easily fix this locally, but it might not be as obvious to everyone.
What happened?
I found an error in the
zinit plugins
command on WSL2/Ubuntu-22.04/zsh-5.8.1 combo.This is a fresh install,
.zshrc
only has zinit's installation and initialization (no plugins at all)This does not happen on MacOS with zsh 5.9 but replicated on another machine with same setup.
Steps to reproduce
Just install zsh from apt in a fresh Ubuntu 22.04 on WSL2 on Windows 10 Create a .zshrc containing only the following:
Start zsh and wait until zinit is installed Run
zi plugins
Relevant output