prezto fails to load after update, giving me parse error without noticeable reason

StackOverflow https://stackoverflow.com/questions/21956836

  •  15-10-2022
  •  | 
  •  

Pregunta

Sometime ago I did a change from oh-my-zsh to prezto. It was a trippy installation process, but after it was working I was very happy. Boot-up time for terminal window changed dramatically. I was pretty happy with this ancient version of prezto, but just of curiosity decided to update.

I did as it was proposed on github page.

git pull && git submodule update --init --recursive

And now I see these three errors then I start up terminal.

/Users/lun/.zshenv:10: parse error near `fi'
/Users/lun/.zprofile:74: parse error near `fi'
.zprezto/init.zsh:50: parse error near `elif' 

Before there more errors, but I cleaned them up. It looked like a wrong encoding for some characters, but not for these.

https://gist.github.com/skatkov/9157258

Because of that prezto fails to load.

Maybe I'm missing something?

¿Fue útil?

Solución

I fixed it, thanks to #zsh channel on freenode.

Issue was with my git config, it forced windows line endings. (linux uses LF (^J) for line endings, windows CRLF (^M^J))

If 'git config --global core.autocrlf' returns true you should:

  1. Backup your zrpezto config (i just committed all changes and pushed to my own github repo)
  2. Set 'git config --global core.autocrlf false'
  3. Delete prezto dir 'rm -r ~/.zprezto'
  4. Checkout prezto and apply your config.
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top