From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2129 invoked by alias); 27 Mar 2012 15:26:08 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 16926 Received: (qmail 5138 invoked from network); 27 Mar 2012 15:26:04 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,RCVD_IN_DNSWL_LOW, T_DKIM_INVALID autolearn=no version=3.3.2 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.215.43 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=QFR24KqOLbNig7WcEOJmJpqajZ4E5rIJcPRR9u1KkxI=; b=Y/Q92PB5XXEscN6to56d8N3qLmUA37PTTMEq7uF1Ai8WEGsCp4sP3F05NW6JNKa2Ha LtscU/DmJAVEAqDNZhoNNlnaqhMq3KtjkWG/CJ3Vco46zGQjrp0huVa1/MyhlrqCXV+u g3KWksRNJBnfIgyLx0j74D/r8QZwwFBrR8UJKXUdpsd5rCdVo0OcmKg6XySnoGSUCULy yC6Ka0SFb5dFpSU1iAaD6SxwD6eV9UDYqX4+4+QR0k9sKiyt7gECOlS/rTFgEXSxJo9n LgWa6NYFf3buLx0Y21vGRt42VMvfVaTRKEh05MKse1zs25GiKx/KkcpyvYm1FlU+Zx6y e0Tw== MIME-Version: 1.0 In-Reply-To: <120327073414.ZM6783@torch.brasslantern.com> References: <120327073414.ZM6783@torch.brasslantern.com> From: Richard Hartmann Date: Tue, 27 Mar 2012 17:25:38 +0200 Message-ID: Subject: Re: `cd .` in non-existent directory leads into weird corner case To: Bart Schaefer Cc: zsh-users@zsh.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Tue, Mar 27, 2012 at 16:34, Bart Schaefer wr= ote: > 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. =C2=A0Bash 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