Hi, when zsh was compiled with static USE flag being enabled the $USERNAME variable is not available: @cobalt:~> echo $SHELL $ZSH_VERSION /bin/zsh 4.3.17 @cobalt:~> echo $USERNAME @cobalt:~> export USERNAME="$(whoami)" @cobalt:~> echo $USERNAME @cobalt:~> echo $PS1 %n@%m:%~> @cobalt:~> As you can see, %n in my prompt doesn't get expanded as well as it's using the USERNAME variable. I've tested this with zsh-4.3.15 and zsh-4.3.17 both on a stable x86 and amd64 machine.
I just got told that one cannot assign a value to the USERNAME variable. So the test case can be reduced to this: @cobalt:~> echo $SHELL $ZSH_VERSION /bin/zsh 4.3.17 @cobalt:~> echo $USERNAME @cobalt:~> echo $PS1 %n@%m:%~> @cobalt:~> On a dynamically linked zsh USERNAME is not empty: lars@shanghai:~> echo $SHELL $ZSH_VERSION /bin/zsh 4.3.17 lars@shanghai:~> echo $USERNAME lars lars@shanghai:~> echo $PS1 %n@%m:%~> lars@shanghai:~> and thus %n gets expanded in the prompt.
might be a bug in glibc ...
This is no longer issue with current zsh in tree.