Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 412301 - app-shells/zsh[static] - $USERNAME is not available
Summary: app-shells/zsh[static] - $USERNAME is not available
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Lars Wendler (Polynomial-C)
Depends on:
Reported: 2012-04-17 07:51 UTC by Lars Wendler (Polynomial-C)
Modified: 2019-11-18 04:43 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Note You need to log in before you can comment on or make changes to this bug.
Description Lars Wendler (Polynomial-C) gentoo-dev 2012-04-17 07:51:00 UTC

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

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.
Comment 1 Lars Wendler (Polynomial-C) gentoo-dev 2012-04-17 08:10:27 UTC
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

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@shanghai:~> echo $PS1     

and thus %n gets expanded in the prompt.
Comment 2 SpanKY gentoo-dev 2014-12-31 08:03:00 UTC
might be a bug in glibc ...