zsh-workers
 help / color / mirror / code / Atom feed
* Bug with named dirs in prompt expansion
@ 2013-07-26 18:58 Manuel Presnitz
  2013-07-26 22:31 ` Phil Pennock
  0 siblings, 1 reply; 5+ messages in thread
From: Manuel Presnitz @ 2013-07-26 18:58 UTC (permalink / raw)
  To: zsh-workers

Dear all,

is it just me, or is there a bug in the "%~" prompt expansion:

$ export PS1='%~> '
~> zsh -f
~> cd /tmp
/tmp> fooo=$PWD
/tmp> : ~fooo
/tmp> foo=$PWD
/tmp> : ~foo
~foo> hash -d | grep tmp
foo=/tmp
fooo=/tmp
~foo>

I would expect that after ": ~fooo" the prompt changes to "~fooo>", but it doesn't.
With one "o" less it's working. But both variant, i.e. "fooo" and "foo", are listed in
the named dir hash, and "cd ~fooo" is working, too.

I seems to depend on the length of the path-string, because in /tmp1 this works:
/tmp1> fooo=$PWD
/tmp1> : ~fooo
~fooo>

But with one character more, i.e. length(namedir) > lentgh(tmp1), it fails again.

Although I use named dirs a lot, I never came about a problem in "real life",
probably because the named dir names are usually shorter than the path;
this issue was originally raised here: http://superuser.com/q/624603/195224
I tried to boil it down to a minimal example.

The behavior above is reproducable with

$ echo $ZSH_VERSION $ZSH_PATCHLEVEL `uname -mo`
4.3.10 Debian x86_64 GNU/Linux
and
5.0.2-dev-0 zsh-5.0.2-130-gc5d9abc i686 Cygwin

Thanks,
Manuel.



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-07-28 12:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-26 18:58 Bug with named dirs in prompt expansion Manuel Presnitz
2013-07-26 22:31 ` Phil Pennock
2013-07-27  8:24   ` Re[2]: " Manuel Presnitz
2013-07-27 22:15     ` Phil Pennock
2013-07-28 12:09       ` Re[4]: " Manuel Presnitz

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).