Description of problem: On a freshly installed F9, print -P "%M %m" returns nothing while on a RHEL 5.2 (for instance) it gives you the FQDN then the hostname. Version-Release number of selected component (if applicable): 4.3.4-8.fc9 How reproducible: Always Steps to Reproduce: 1. print -P "%M %m" Actual results: Empty strings Expected results: As per the man page: %M The full machine hostname. %m The hostname up to the first ‘.’. An integer may follow the ‘%’ to specify how many components of the hostname are desired. With a negative integer, trailing components of the hostname are shown.
% print -P "%M %m" code.and.org code % yum list zsh Installed Packages zsh.x86_64 4.3.4-8.fc9 installed ...got anymore info?
zsh.i386 4.3.4-8.fc9 installed On my machine (I've got another one at home): %hostname foobar %print -P "%M" % And foobar is in /etc/hosts (I mean a getent ahosts foobar works)... I guess I'm going to dig in the source...
BY the way I also tried to move my .zshrc out of the way, same result...
Ok, interesting ... if I do "zsh -f" then print "%M" just prints %M. PROMPT EXPANSION Prompt sequences undergo a special form of expansion. This type of expansion is also available using the -P option to the print builtin. ...and print -P "%M" works in zsh -f.
Nice find, with zsh -f, print -P "%M" works again...
Found the culprit, I added this to zshrc: --- zshrc.orig 2008-05-16 06:17:09.000000000 +0200 +++ zshrc 2008-09-24 11:10:39.000000000 +0200 @@ -26,7 +26,9 @@ if [[ ! -o login ]]; then # We're not a login shell for i in /etc/profile.d/*.sh; do if [ -r "$i" ]; then + echo $i . $i + print -P "%M %m" fi done unset i And basically it stops here: tangerine tangerine /etc/profile.d/keychain.sh So keychain seems to be at fault. The issue is this line: unset KCHOPTS SSHKEYS GPGKEYS HOST If you unset HOST, print -P "%M" (or %m) fails... %echo $HOST %print -P "%m %M" %HOST=foobar %print -P "%m %M" foobar foobar Can we transfer this bug to keychain instead of rpm?
I meant "transfer to keychain instead of zsh" of course...
Closed (new bug is 463913).