zsh setopt posixargzero weird behaviour
Hello,
I recently switched to zsh with powerlevel9k (thanks a lot for the work, awesome theme). Everything works fine but I work on embedded software and I use an OS in my applications, to be able to use this in my programs I have to source a script they provide to export properly env variables. I noticed that when I source this script, afterwards powerlevel9k outputs an error on prompt: set_default:typeset:4: not valid in this context: POWERLEVEL9K_/USR/BIN/ZSH_OK_VISUAL_IDENTIFIER_COLOR
I took a look at what the script does and at the start it does this:
if [ -n "$ZSH_VERSION" ]; then
DIR="${(%):-%N}"
if [ $options[posixargzero] != "on" ]; then
setopt posixargzero
NAME=$(basename -- "$0")
setopt posixargzero
else
NAME=$(basename -- "$0")
fi
else
DIR="${BASH_SOURCE[0]}"
NAME=$(basename -- "$0")
fi
So I spawned a shell and tried to enter setopt posixargzero and I got to reproduce the issue.
setopt posixargzero
set_default:typeset:4: not valid in this context: POWERLEVEL9K_/USR/BIN/ZSH_OK_VISUAL_IDENTIFIER_COLOR
This made me realise first that my OS script does setopt twice instead of unsetopt the second time. But I was wondering if this behaviour was as expected for powerlevel9k?
Thanks for your help
@leodido99 Sorry for the delay. What version of ZSH do you have on your embedded system?
No problem :)
zsh --version zsh 5.6.2 (x86_64-redhat-linux-gnu)
Crazy. If I set this option, I get no error message, but the prompt is pretty broken. Looks like we need to set noposixargzero. But to be honest that has no high prio in my list. I am sure there are some other options that would break the prompt as well..
@leodido99 If you are still using Powerlevel9k, could you check if this issues can be reproduced with Powerlevel10k?
This doesn't seem to be reproductible with Powerlevel10k