Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Problem with _cd return code
- X-seq: zsh-workers 12711
- From: Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxx
- Subject: Re: Problem with _cd return code
- Date: Mon, 28 Aug 2000 09:13:23 +0200 (MET DST)
- In-reply-to: "Andrej Borsenkow"'s message of Mon, 28 Aug 2000 10:33:34 +0400
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
Andrej Borsenkow wrote:
> ... when completing directory stack (cd -TAB). It completes it alright, but it
> always beeps; and sometimes I get additionally external directories listed.
>
> It looks like return code problem, but I could not figure out how to fix it. I
> do not quite understand, what _wanted, _requested etc are supposed to return.
The same as all completion functions, of course: zero if matches were
added, non-zero otherwise.
What's happening is quite easy to see in _cd. That calls _popd for the
directory stack like this:
elif _popd || [[ $PREFIX != (\~|/|./|../)* && $#cdpath -ne 0 ]]; then
So, if _popd succeeds (adds matches), we go on completing, forgetting
about the zero-return from _popd and instead using the return value of
one of the calls to _wanted or the return value from _alternative as
the result of _cd.
We should probably change that to something like:
else
_popd && ret=0
if [[ $PREFIX != (\~|/|./|../)* && $#cdpath -ne 0 ]]; then
...
else
...
fi
return ret
fi
Unless I'm missing something that was intended by whoever wrote that.
Bye
Sven
--
Sven Wischnowsky wischnow@xxxxxxxxxxxxxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author