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

Re: `cd .` in non-existent directory leads into weird corner case



On 2 April 2012 12:12, Peter Stephenson <Peter.Stephenson@xxxxxxx> wrote:
> On Mon, 2 Apr 2012 11:52:02 +0200
> Richard Hartmann <richih.mailinglist@xxxxxxxxx> wrote:
>> On Tue, Mar 27, 2012 at 16:34, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>>
>> > However, I've always been a little puzzled about the decision to set
>> > $PWD to "." in this case.  Bash remembers the relative location:
>>
>> 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? Sometimes I mv
directories and like to end up in the correct place when I cd .. in a
shell that was 'moved'. Maybe this case wouldn't be affected, but it
still feels more consistent to me if I keep following the physical
links even if it was deleted.

-- 
Mikael Magnusson



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