From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19896 invoked from network); 4 Nov 1998 12:43:36 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 4 Nov 1998 12:43:36 -0000 Received: (from list@localhost) by math.gatech.edu (8.9.1/8.9.1) id HAA16026; Wed, 4 Nov 1998 07:41:28 -0500 (EST) Resent-Date: Wed, 4 Nov 1998 07:41:28 -0500 (EST) Message-Id: <9811041226.AA32302@ibmth.df.unipi.it> To: zsh-workers@math.gatech.edu (Zsh hackers list) Subject: PATCH: Re: Strange prompting in new 3.1.5 In-Reply-To: ""Zefram""'s message of "Wed, 04 Nov 1998 12:27:49 NFT." <199811041227.MAA14200@diamond.tao.co.uk> Date: Wed, 04 Nov 1998 13:26:13 +0100 From: Peter Stephenson Resent-Message-ID: <"QJKd02.0.Lw3.uj4Gs"@math> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/4533 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu "Zefram" wrote: > Stucki wrote: > >I installed the new Version 3.1.5 and since then my > >(unchanged) 'prompt' always showed '~PWD' where '%~' > >is expanded. > > Basically, AUTO_NAME_DIRS is a really bad idea if you want to do > %~ expansion. Think about it: ~PWD is always a correct name for the > directory you're in. It's just not useful. Even if we make an exception > for PWD, there's nothing stopping other parameters being equally unhelpful > (OLDPWD, and anything the user uses in the chpwd function). But %~ doesn't use OLDPWD and users can make arrangments for their own variables, whereas PWD is set by the shell and it's up to the shell to make it useful. I don't think it's good enough simply saying %~ and autonamedirs are incompatible; that's the shell's fault, not the user's. *** Src/utils.c.pwd Fri Oct 30 16:37:18 1998 --- Src/utils.c Wed Nov 4 13:16:17 1998 *************** *** 510,515 **** --- 510,519 ---- if ((flags & ND_USERNAME) && nameddirtab->getnode2(nameddirtab, s)) return; + /* Never hash PWD, because it's never useful */ + if (!strcmp(s, "PWD")) + return; + /* Normal parameter assignments generate calls to this function, * * with always==0. Unless the AUTO_NAME_DIRS option is set, we * * don't let such assignments actually create directory names. * -- Peter Stephenson Tel: +39 050 844536 WWW: http://www.ifh.de/~pws/ Dipartimento di Fisica, Via Buonarotti 2, 56100 Pisa, Italy