From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26934 invoked by alias); 2 Apr 2012 11:10:22 -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: 16954 Received: (qmail 8751 invoked from network); 2 Apr 2012 11:10:21 -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.160.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:date:message-id:subject:from:to :cc:content-type; bh=/jtpVt8uuPCiNwpy/DKwz2FYCOyrPRp6JnofKC9tdXQ=; b=VI+NmVDWOw3pYBY42/Zan0Y9cFcs5KKFJ2VJcJ8AcNB/U5CzFHWoDXTENxLSfLg+KK tFrdL2ZTxZSz50FWa7ZuDKQG6W8HSb+ZlqgIXZSU0xa6TvpQ88cKb3w7HtGWc0bp2h0z zmszMP+GVcsX/gkduYds7jYZXWPwzW7M/wixc3U1mRqVS0XrhCqQMXT5acil6Wce32J3 2EgclKbXajtaWOA5va1+jju7tPWLp9veQ+65qEK+VT12FobC51aX4kl2CArVkgz2A5Ef UHcr+lZS2CBpSk7V6IqgJYa/kVigu8GIr+eRyl4+cEgiTMZ57Ns2yY69XSafhUDy5MsM D56w== MIME-Version: 1.0 In-Reply-To: <20120402120008.0ed7e583@pwslap01u.europe.root.pri> References: <120327073414.ZM6783@torch.brasslantern.com> <20120402111219.62cbd0c7@pwslap01u.europe.root.pri> <20120402120008.0ed7e583@pwslap01u.europe.root.pri> Date: Mon, 2 Apr 2012 13:10:17 +0200 Message-ID: Subject: Re: `cd .` in non-existent directory leads into weird corner case From: Mikael Magnusson To: Peter Stephenson Cc: zsh-users@zsh.org Content-Type: text/plain; charset=UTF-8 On 2 April 2012 13:00, Peter Stephenson wrote: > On Mon, 2 Apr 2012 12:56:55 +0200 > Mikael Magnusson wrote: >> >> Just to make sure this does not get lost, do we agree that not >> >> changing $PWD to a literal dot would make sense? Escalating the ENOENT >> >> to the user is probably the best approach. >> > >> > Sounds OK. Silently failing and changing the directory reported doesn't >> > really do a lot of good to anyone. >> >> Can we keep the current behaviour for cd -P? > > I think that only those cases that currently give up and silently revert > to "." as the current directory would be affected, so anything that > already did something sensible would still do that. Certainly that's > what we should be aiming for. One (semi-)realistic case I came up with, one shell sits in a directory, someone else first moves the directory, then deletes it, then the shell tries to 'cd ..'. In this case I would like it to end up in the new parent directory as it does now [1], not the old "$PWD:h". (with chasedots/-P) (and even if I did 'cd .' first for some weird reason). -- Mikael Magnusson [1] {13:08:58|~}% mkcd foo {13:09:04|~/foo}% mv ~/foo ~/tmp # ~/tmp already exists {13:09:07|~/foo}% rmdir ~/tmp/foo {13:09:09|~/foo}% cd .. {13:09:09|~/tmp}%