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

Re: cd, pwd and symlinks

On Sep 27,  7:05pm, Stefan Monnier wrote:
> Subject: Re: cd, pwd and symlinks
> >>>>> "Adam" == Adam Spiers <adam@xxxxxxxxxxxxxxxxxxxxxxx> writes:
> > Put `setopt chaselinks' or `setopt chasedots' in your .zshrc.  From
> > the info pages:
> I must say I don't like the names and defaults.  The names give the
> impression that chasing links is a very unusual feature while it's the
> normal unix behavior.

It's not, however, the normal zsh behavior, and has not been for a very long
time.  It may even date back to a specific personal preference of Falstad's;
I don't recall for certain now.

> But apart from that, I'm more often annoyed by `pwd' not checking the
> value it returns

"pwd" is nothing more than a slightly fancified alias for "echo $PWD", and
PWD does not get reset every time zsh prints a prompt (unless you do it in
your precmd function).  Rather, it gets reset every time you "cd".

The builtin pwd in bash and (I think) ksh also have the same behavior.
There is no builtin pwd in tcsh, but tcsh does not reset $cwd following
such a "mv" command.

You can always put

	disable pwd

in your init files somewhere, to force zsh to run the external pwd command

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