Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: cd, pwd and symlinks



On Sep 28,  6:42pm, Zefram wrote:
} Subject: Re: cd, pwd and symlinks
}
} Bart Schaefer wrote:
} >On Sep 28, 12:07pm, Peter Stephenson wrote:
} >} There's some reason why the code was changed
} >} to do all changes with absolute path --- maybe to simplify it, hur hur.
} >
} >As far as I can tell, this is something Zefram changed between 3.1.2 and
} >3.1.3, for which no patch was ever posted.
} 
} I'm pretty sure it's not.  That's one of the areas of the shell that I
} studiously avoided changing.

Ah.  Further investigation reveals that this was already changed in 3.1.0;
I've checked the RCS files from that version that are on the FTP site.  So
the next best guess is that Zoltan changed this; see the ChangeLog entry 
for Thu Dec  5 03:59:45 1996, "Lots of other stuff."

} Given that we have to support [PWD], there are basically two sensible
} ways for it to work:
} 
} 1. cd maps directly onto chdir(), doing everything the way the
}    filesystem says.
} 
} 2. $PWD is the shell's canonical idea of its current directory.  cd with
}    a relative pathname does text substitution using $PWD, and then does
}    a chdir() to the resulting absolute pathname.

I generally agree with this viewpoint, but:

} Until 3.1.6, we had a pretty consistent 2.

I don't really agree with that last, the problem being that other parts
of the shell (particularly completion) didn't pay attention to the same
rules, which could lead to all sorts of odd stuff.  I'm not sure we've
completely (ahem) fixed that, even yet.

Certainly there should be at least ONE mode in which "cd .." simply does
chdir(".."), and right now NO mode does so (even after PWS's patch).  I
don't believe any of 3.1.<0-5> did this correctly either.

} Now we have a mixture of the two styles, which isn't working, and
} making it more complicated isn't going to help. Let's just have the
} two ways of working, with an option to switch between them.

This is essentially my feeling too, except that I think we can do better
in the failure cases.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com



Messages sorted by: Reverse Date, Date, Thread, Author