* Prompt %~ (sometimes) expands /local/src/zsh to ~unambiguous
@ 2000-06-28 14:48 Peter Whaite
2000-06-28 14:55 ` Sven Wischnowsky
0 siblings, 1 reply; 3+ messages in thread
From: Peter Whaite @ 2000-06-28 14:48 UTC (permalink / raw)
To: zsh-workers
I have noticed that every now and then `print -P "%~"` prints "~unambiguous".
Today I noticed it (in my xterm title) after 'cd /local/src/zsh'. This was
with yesterdays zsh-3.1.9-dev-1 cvs version. I tried zsh-3.1.9 and that
worked OK. However I was surprised to find that after I exited the zsh-3.1.9
shell, thus returning to the latest zsh-3.1.9-dev-1, it still worked OK. I
have been unable to get it to misbehave since.
--
peta
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Prompt %~ (sometimes) expands /local/src/zsh to ~unambiguous
@ 2000-06-28 14:55 ` Sven Wischnowsky
2000-06-28 17:05 ` PATCH: " Bart Schaefer
0 siblings, 1 reply; 3+ messages in thread
From: Sven Wischnowsky @ 2000-06-28 14:55 UTC (permalink / raw)
To: zsh-workers
Peter Whaite wrote:
> I have noticed that every now and then `print -P "%~"` prints "~unambiguous".
> Today I noticed it (in my xterm title) after 'cd /local/src/zsh'. This was
> with yesterdays zsh-3.1.9-dev-1 cvs version. I tried zsh-3.1.9 and that
> worked OK. However I was surprised to find that after I exited the zsh-3.1.9
> shell, thus returning to the latest zsh-3.1.9-dev-1, it still worked OK. I
> have been unable to get it to misbehave since.
Haven't investigated any further... the $compstate assoc contains an
element `unambiguous'. Maybe one of the recent changes to the
parameter code...?
And maybe we should add code to prevent the automatic name-dir
behaviour for assoc elements anyway (if we don't have that already and
this is really the cause).
Bye
Sven
--
Sven Wischnowsky wischnow@informatik.hu-berlin.de
^ permalink raw reply [flat|nested] 3+ messages in thread
* PATCH: Re: Prompt %~ (sometimes) expands /local/src/zsh to ~unambiguous
2000-06-28 14:55 ` Sven Wischnowsky
@ 2000-06-28 17:05 ` Bart Schaefer
0 siblings, 0 replies; 3+ messages in thread
From: Bart Schaefer @ 2000-06-28 17:05 UTC (permalink / raw)
To: Peter Whaite, zsh-workers
On Jun 28, 10:48am, Peter Whaite wrote:
}
} I have noticed that every now and then `print -P "%~"` prints "~unambiguous".
On Jun 28, 4:55pm, Sven Wischnowsky wrote:
}
} Haven't investigated any further... the $compstate assoc contains an
} element `unambiguous'. Maybe one of the recent changes to the
} parameter code...?
I don't know if it's one of the recent changes, but that does appear to
be the problem:
zagzig% setopt autonamedirs
zagzig% typeset -A foo
zagzig% foo[bar]=$PWD
zagzig% print -P %~
~bar
} And maybe we should add code to prevent the automatic name-dir
} behaviour for assoc elements anyway (if we don't have that already and
} this is really the cause).
Actually, I have a longstanding request that ~foo[bar] should work ...
but that means changing the parser ...
Certainly assigning to foo[bar] shouldn't define ~bar.
Index: Src/params.c
===================================================================
@@ -2020,6 +2020,7 @@
oldpm = pm->old;
paramtab->addnode(paramtab, oldpm->nam, oldpm);
if ((PM_TYPE(oldpm->flags) == PM_SCALAR) &&
+ !(pm->flags & PM_HASHELEM) &&
oldpm->sets.cfn == strsetfn)
adduserdir(oldpm->nam, oldpm->u.str, 0, 0);
if (oldpm->flags & PM_EXPORTED) {
@@ -2104,7 +2105,8 @@
{
zsfree(pm->u.str);
pm->u.str = x;
- adduserdir(pm->nam, x, 0, 0);
+ if (!(pm->flags & PM_HASHELEM))
+ adduserdir(pm->nam, x, 0, 0);
}
/* Function to get value of an array parameter */
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.brasslantern.com
Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2000-06-28 17:06 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-06-28 14:48 Prompt %~ (sometimes) expands /local/src/zsh to ~unambiguous Peter Whaite
2000-06-28 14:55 ` Sven Wischnowsky
2000-06-28 17:05 ` PATCH: " Bart Schaefer
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).