powerlevel10k: Incompatible with zsh-syntax-highlighting?

Hi there. First of all many thanks for your hard work on this, I’m loving pl10k!

I’ve found an issue when trying to use it along with the zsh-syntax-highlighting plugin. I’ve installed zsh-syntax-highlighting directly in my ~/.zshrc file as described in their readme file. In the readme they say that you must source the file at the end of .zshrc.

But whenever it’s enabled, the powerlevel10k prompt stops working, in the meaning that it won’t be updated anymore. Changing directories, running commands, etc. will not change the prompt at all. It will remain exactly the same as when you first open the session.

Let me know if you need me to provide additional info or perform some debugging for you.

  • macOS 10.14.6
  • iTerm2
  • oh-my-zsh
  • powerlevel10k installed according to this.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 20 (10 by maintainers)

Most upvoted comments

Thanks for the logs. It’s a bug in zsh-syntax-highlighting. Or, more precisely, a bug in zsh that gets triggered by zsh-syntax-highlighting. I submitted an issue upstream: https://github.com/zsh-users/zsh-syntax-highlighting/issues/733.

This bug only affects older versions of zsh (this is why I wasn’t able to reproduce this on my machine). As mitigation I suggest upgrading zsh to 5.8. You can do this with brew install zsh. If you don’t have brew, see https://brew.sh/. Upgrading zsh to 5.8 is generally a very good idea. It’s much faster than what you have and much more stable.

You also need to fix this line in ~/.p10k.zsh:

typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIINS_CONTENT_EXPANSION=' $'

This parameter has “expansion” in its name for a good reason. Its value undergoes single word expansion. If you want to display $ instead of the default , you need to escape it with \. Like so:

typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIINS_CONTENT_EXPANSION=' \$'