zsh-users
 help / color / mirror / code / Atom feed
From: Richard Hartmann <richih.mailinglist@gmail.com>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: zsh-users@zsh.org
Subject: Re: `cd .` in non-existent directory leads into weird corner case
Date: Tue, 27 Mar 2012 17:25:38 +0200	[thread overview]
Message-ID: <CAD77+gTn+j3yV_CxgALZ8C81mVfRT7_Sk7wW98HtSAYt11czdg@mail.gmail.com> (raw)
In-Reply-To: <120327073414.ZM6783@torch.brasslantern.com>

On Tue, Mar 27, 2012 at 16:34, Bart Schaefer <schaefer@brasslantern.com> wrote:

> I believe the thinking was that the harm has already been done once the
> current directory has been removed out from under the shell.

Yes-ish; zsh is arguably making it worse by locking itself into a
relative path prison.


> Possibly; I seem to recall a (very long ago) discussion in which it was
> concluded that the situation arose so rarely as to not be of concern.
> How often does one "cd ." ?

With git branches, the deletion of directories you were just in is
relatively common, sometimes git will delete the underlying directory
and create a new one with the same name, instead. This confuses
vcs_info. `cd .` is my default way of making vcs_info read in its info
again.


> Various external commands such as "ls" silently exit with success on a
> non-existent current working directory, I think that may have been the
> model for the original behavior.

They fail silently, they don't lock themselves in.


> However, I've always been a little puzzled about the decision to set
> $PWD to "." in this case.  Bash remembers the relative location:

And that's pretty much the beef. Would it be acceptable to change this
behavior if `cd .` does not start throwing errors?


> Of course zsh already does magic in that case:

Interesting; while maybe handy, I think I would prefer it to fail
instead of DWIM.


Richard


  reply	other threads:[~2012-03-27 15:26 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-27  0:56 Richard Hartmann
2012-03-27  5:13 ` Daniel Shahaf
2012-03-27 14:34 ` Bart Schaefer
2012-03-27 15:25   ` Richard Hartmann [this message]
2012-04-02  9:52   ` Richard Hartmann
2012-04-02 10:12     ` Peter Stephenson
2012-04-02 10:56       ` Mikael Magnusson
2012-04-02 11:00         ` Peter Stephenson
2012-04-02 11:10           ` Mikael Magnusson
2012-04-02 11:39             ` Peter Stephenson
2012-04-03  9:51             ` Richard Hartmann
2012-04-03  9:57             ` Peter Stephenson
2012-04-03 10:16               ` Mikael Magnusson
2012-04-03 11:11                 ` Richard Hartmann
2012-04-03 14:06                 ` Bart Schaefer
2012-04-02 10:15     ` Mikael Magnusson
2012-04-02 10:33       ` Peter Stephenson
2012-04-02 10:46         ` Mikael Magnusson
2012-04-02 11:07       ` Vincent Lefevre
2012-04-02 12:59       ` Richard Hartmann
2012-04-03  4:04         ` Jun T.
2012-04-03 14:43           ` Vincent Lefevre
2012-04-04 17:03             ` Jun T.
2012-04-05 14:20               ` Vincent Lefevre
2012-04-05 16:17                 ` Jun T.
2012-04-15  1:17                   ` Vincent Lefevre
2012-04-15 18:07                     ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAD77+gTn+j3yV_CxgALZ8C81mVfRT7_Sk7wW98HtSAYt11czdg@mail.gmail.com \
    --to=richih.mailinglist@gmail.com \
    --cc=schaefer@brasslantern.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).