zsh-workers
 help / color / mirror / code / Atom feed
* Directory stack and pushd/popd in zsh-2.6-beta17
@ 1996-05-10  9:51 Juha Leskel{
  1996-05-10 15:19 ` Anthony Heading
  0 siblings, 1 reply; 2+ messages in thread
From: Juha Leskel{ @ 1996-05-10  9:51 UTC (permalink / raw)
  To: zsh-workers


Hello!

First I would like to thank you for the beta17 release, I was really waiting
for the full character support.

Then to questions. I noticed that in this release popd builtin doesn't work
as it used to. It really doesn't change the working directory. I tried it
with and without pushd command ( I have autopushd option set ), but the
result was the same. I also tried to unset autopushd option and without my
chpwd function. I checked what is happening to the directory stack and
here is something funny:

myprompt % pwd
/disks/tennari/users/jussa
myprompt % dirs -v
0       /disks/tennari/users/jussa
1       /disks/lapikas2/bin
2       /disks/lapikas2/bin/X11
3       /disks/mono2/local
4       /usr
5       /
6       /disks/tennari/users
myprompt % popd
myprompt % pwd
/disks/tennari/users/jussa
myprompt % dirs -v
0       /disks/tennari/users/jussa
1       /disks/lapikas2/bin/X11
2       /disks/mono2/local
3       /usr
4       /
5       /disks/tennari/users
myprompt % 

popd buitin seems to take out directory stack entry numbered "1" and then
rearrange the rest of the stack and then change to directory entry numbered
"0" which is where we currently are!

So is this happening to everybody or am I doing something wrong here? Please
reply to me if you can help me, I am not on the zsh-workers list.

This is what I have:

ZSH_VERSION=2.6-beta17
DIRSTACKSIZE=100
HOSTTYPE=hpux9.05
Compiler: HP92453-01 A.09.77 HP C Compiler



		Juha Leskela



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

* Re: Directory stack and pushd/popd in zsh-2.6-beta17
  1996-05-10  9:51 Directory stack and pushd/popd in zsh-2.6-beta17 Juha Leskel{
@ 1996-05-10 15:19 ` Anthony Heading
  0 siblings, 0 replies; 2+ messages in thread
From: Anthony Heading @ 1996-05-10 15:19 UTC (permalink / raw)
  To: Juha Leskel{; +Cc: zsh-workers

> Then to questions. I noticed that in this release popd builtin doesn't work
> as it used to. It really doesn't change the working directory. I tried it
> with and without pushd command ( I have autopushd option set ), but the
> result was the same. I also tried to unset autopushd option and without my
> chpwd function. I checked what is happening to the directory stack and
> here is something funny:
> 

Shoot!  This is my fault I think. At least it seems to be if you have
CHASE_LINKS set. 

The problem appears to be that I changed cd_get_dest to return the "targetted"
entry on the directory stack.  For cd and pushd this is fine. But for popd, that's
the directory to be killed, not to be changed to.  So the code is going through
the machinations of changing to this wrong dir, but the day is saved in bin_cd(),
which actually changes to the correct dir, *except* if CHASE_LINKS is set.

I'll try to work out a fix this weekend.  It might involve restructuring that
whole section of code, since the way it's split into multiple functions is
actually rather unhelpful. 

Just in case I'm about to screw up, could someone tell me what that code at the end
of bin_cd() ( stat() and stat() and notequal and chdir() ) is supposed to catch?
I can't see why the previous functions shouldn't do the job properly.

Sorry about this. Any input or suggestions from anyone who cares to look at it
happily taken on board...

Anthony




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

end of thread, other threads:[~1996-05-10 15:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-05-10  9:51 Directory stack and pushd/popd in zsh-2.6-beta17 Juha Leskel{
1996-05-10 15:19 ` Anthony Heading

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