From: Peter Stephenson <pws@ibmth.df.unipi.it>
To: zsh-workers@math.gatech.edu (Zsh hackers list)
Subject: PATCH: Re: Strange prompting in new 3.1.5
Date: Wed, 04 Nov 1998 13:26:13 +0100 [thread overview]
Message-ID: <9811041226.AA32302@ibmth.df.unipi.it> (raw)
In-Reply-To: ""Zefram""'s message of "Wed, 04 Nov 1998 12:27:49 NFT." <199811041227.MAA14200@diamond.tao.co.uk>
"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 <pws@ibmth.df.unipi.it> Tel: +39 050 844536
WWW: http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarotti 2, 56100 Pisa, Italy
next prev parent reply other threads:[~1998-11-04 12:43 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
1998-11-04 11:44 Stucki
1998-11-04 12:03 ` Bruce Stephens
1998-11-04 12:27 ` Zefram
1998-11-04 12:26 ` Peter Stephenson [this message]
1998-11-04 16:21 ` Bart Schaefer
1998-11-10 10:19 ` PATCH: 3.1.5: alternative PWD patch Peter Stephenson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9811041226.AA32302@ibmth.df.unipi.it \
--to=pws@ibmth.df.unipi.it \
--cc=zsh-workers@math.gatech.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).