From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 439 invoked from network); 17 Jul 1998 10:36:16 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 17 Jul 1998 10:36:16 -0000 Received: (from list@localhost) by math.gatech.edu (8.9.1/8.9.1) id GAA03297; Fri, 17 Jul 1998 06:28:56 -0400 (EDT) Resent-Date: Fri, 17 Jul 1998 06:28:56 -0400 (EDT) Message-Id: <35AF27D6.7362E041@hp.com> Date: Fri, 17 Jul 1998 12:30:46 +0200 From: Dominik Vogt Organization: Hewlett-Packard GmbH X-Mailer: Mozilla 4.05 [en] (WinNT; I) Mime-Version: 1.0 To: zsh-workers@math.gatech.edu Subject: bug with chpwd/allexport Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Resent-Message-ID: <"cCY1l1.0.Sp.dTohr"@math> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/4233 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu Hi folks, a while ago I discovered a bug in zsh 3.05 (I was working with the NT version by Amol Deshpande). I'm not sure if Amol reported it here already. The problem is, that is you have the ALLEXPORT and the AUTONAMEDIRS option set and use a variable in your chpwd function (e.g. to build a string to print it on the windows title bar), the variable is immediately put into the hashtable for named directories. And if you have a '%~' in your prompt, it is replaced with the name of the variable. You can reproduce it this way: # export PS1='%~>' ~ > setopt ALLEXPORT ~ > setopt AUTONAMEDIRS ~ > function chpwd () { > FOO=$PWD > echo $FOO > } ~ > cd /etc /etc $FOO > Have a look at the prompt on the last line. I've reproduced this with NT and LINUX, so it is not a porting problem. I had a look at the source code but could not see an easy way to fix this. At first I thought, one could handle the zsh- specific function in a special way to prevent variables used in there from going into hashtables, but the user could call the function himself. This would entail a lot of changes probably not worth the effort. What I suggest is: Just document it in the manpage. There should be at least a hint on this problem where the two options are described and in the description of the chpwd function. There is a simple workaround: function chpwd () { setopt LOCALOPTIONS unsetopt AUTONAMEDIRS unsetopt ALLEXPORT FOO=$PWD echo $FOO } Please respond to me by email. Bye Dominik -- ------------------------------------------------------------------------ Dominik Vogt phone: 07031/14-4596 Hewlett-Packard GmbH fax: 07031/14-3883 Boeblingen Verification Solutions Herrenberger Str. 130 71034 Boeblingen email: dominik_vogt@hp.com ------------------------------------------------------------------------