zsh-workers
 help / color / mirror / code / Atom feed
From: "Manuel Presnitz" <mpy@gmx.net>
To: zsh-workers@zsh.org
Subject: Bug with named dirs in prompt expansion
Date: Fri, 26 Jul 2013 20:58:36 +0200	[thread overview]
Message-ID: <201307262058360115.008E9ADA@mail.gmx.net> (raw)

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.



             reply	other threads:[~2013-07-26 19:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-26 18:58 Manuel Presnitz [this message]
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

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=201307262058360115.008E9ADA@mail.gmx.net \
    --to=mpy@gmx.net \
    --cc=zsh-workers@zsh.org \
    /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).