From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 14008 invoked from network); 8 Jun 2022 16:16:09 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 8 Jun 2022 16:16:09 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1654704969; b=K2drKON0DBANKx130lCgj4TJ0Lu6alIHFuJBdmV8vg3GidZlLWb+74vOBsHRjAz/JdMHujYQNU 9C3ewUKgkBbsc4NY1I4f72xSxB9v2MHRMBJ3RrPez8+BAv2qg8Z+xZdhql8wTYntKWXjc+vhoO Gjj5c+LTeWsc4totR6g/xUiHDy8MTQobL0tPUXeUrzdQGBxajyC71F4FRcBFEH851vX+zdc39p r0WtAwRXoT8yuSI8Vo13TKzH0DXwdbMjdPI8YgALNjRy0F8ord5nurSmjzLPwdA0UdubtlNjAA teN9+NVAC6sfsemFePLLpC3iebMnKvnm9uXi4uTsJooxIA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ed1-f50.google.com) smtp.remote-ip=209.85.208.50; dkim=pass header.d=brasslantern-com.20210112.gappssmtp.com header.s=20210112 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1654704969; bh=6Ozdb4qsTXD5iP03n8X0EY4lT3vNfpzW8ThZR3P0Ixo=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=SzCVhJuxoMOQJP9HIxR1ghfMpwY9gOH4u3GkjdPLjBWk54H+vZqzcQ8EZsD9W5l3bkkwzdSYRY ur0wM8t2kPhpMsLkZqHG1X8q9m49QWGH4Vk8ldJUpuwd1lEt092L9Bfem+pw2GR1y5EDBSQRy8 mPLCmhrxwTXdZ2tbsCHsxmvA3taZnRgIZJscNbwLY+JxL5FNuDPdGAPPNz5C1eIyqA/xjc6DAU B/pbk4O8up5zzfJfH7Lzgt4Wv/yMDDSV0gxnlzlkkkaDbZLqAgQop9qq7WcU5NHd4IaMqcSz8Y ekT6RcYU9Q/PQ6St8cvK4WAidYBmInvSRv6sP+N5yqUbhA==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References:MIME-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=ygX8v1ve+Dzb6GU+Osjp4bm6IOONnDQQOuiqh7aWXpA=; b=gYHdr59tobTDlk9a1IxSbU20DQ n6X6CY9CpwlCHc3hyNl5mmPNZ/24q+SHpHAXA6AxGBhqed9avvSToUS6rar0mz0921Flkda1GN/FO RPwUjDdXe8wAwdP9BMwvjVC154F0KCtwdYf8ILC39VxeFYVY92AtVg1xismQp9LoEYEc53wGP90q5 FEPBkReQuytCQC15wkzH2HWHbW7GZKzVbEKrZu4DrlZBWD7SVyS4pb3GR5UW2d1X9jU3+diwcJqqn /Ts4jlTQ7Qwwzub1cnX1AaDsCPoI4/TLZNm3pgsu/JhcOkjwsQzeCmHjEwNtejCUhOPXE3ErrqwVh oEM7UgGQ==; Received: from authenticated user by zero.zsh.org with local id 1nyyLo-000Krg-Jr; Wed, 08 Jun 2022 16:16:08 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ed1-f50.google.com) smtp.remote-ip=209.85.208.50; dkim=pass header.d=brasslantern-com.20210112.gappssmtp.com header.s=20210112 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-ed1-f50.google.com ([209.85.208.50]:46811) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1nyyLG-000KX0-49; Wed, 08 Jun 2022 16:15:35 +0000 Received: by mail-ed1-f50.google.com with SMTP id z7so27748127edm.13 for ; Wed, 08 Jun 2022 09:15:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ygX8v1ve+Dzb6GU+Osjp4bm6IOONnDQQOuiqh7aWXpA=; b=Y9dter7xsOBNlOBKBEi1gEME668wbrD4PIwRu0kdKmru2v6Iria4NrUqmW+J74a4zy 7ExOd6LTWLqwbU9wVT7UMCH3VBLy3+PqtsKAUHmaNs+9ZH9G/mPdd2xXyK30VFJAoh4z Dz0wlEyZUqBRAaAYGzaoggXOU60fJhTi/m2TkfeGG5zy+sxKqf5+vTqgZCBcXrXNDxJw ZLK3yzqy3ghzZUc6N0QybjL2vwBya0wQsZzrNkXGQqYdTZrRaFCELcz4JPPxSv/jXr/N W5f8M/R++MP2rgDG9mXBw/w9fsuueAxjicpkdvtk4aC/zABVD9SOXnoFIG7tB0AkaOGP dsNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ygX8v1ve+Dzb6GU+Osjp4bm6IOONnDQQOuiqh7aWXpA=; b=a2ff6as2r50TVnN5OSatECuxhkLKpwG0WmWWASuYdTwl8egEgxOcFJvvPl+v7NH/dU ofRTo98VmbmzmHCILYHeUhcEEUf5FMubSGZzJQRQMSrduSo4oL2bNDbPRyNc7Oe+2Uzu vSFlLOUb9WPDZup+AC+/EBfdnbi/rSFbfsglAoKJkWwzJB8tLz8CuHDxPnYb58Pq2ysL vpmK9/GoB9NsNrK9YnjEVaApXiuUUDBP96xbMndGSRpdhevhrbafBPbSMQRQWa1sK7eG U+1qAyFpb9kx1t9v3IRW/w0uKxs/djsk18ugvrEq+NSif4fqtj4Y5Cq4bbqy8fT4X/GQ jQeA== X-Gm-Message-State: AOAM530ihkuce75DvEZWZ49jGaUxhH48DUf8Isfu/cJyYzVILy8y8+B0 5qjr3RdaUzJOZpLKG42Qjl5d/oeQXWt7yCHwJR0iXQ== X-Google-Smtp-Source: ABdhPJwP56e6hREaPHSEolBwp55lXHKFS9c5skhWYvF0TAaZEW6w5EJConL7qrNSwo+bK24dkPThhibfvFy87JymoqM= X-Received: by 2002:a05:6402:2945:b0:41d:aad:c824 with SMTP id ed5-20020a056402294500b0041d0aadc824mr39731893edb.364.1654704933512; Wed, 08 Jun 2022 09:15:33 -0700 (PDT) MIME-Version: 1.0 References: <20220608091426.GA15730@tarpaulin.shahaf.local2> <1644026654.700770.1654681319674@mail2.virginmedia.com> In-Reply-To: <1644026654.700770.1654681319674@mail2.virginmedia.com> From: Bart Schaefer Date: Wed, 8 Jun 2022 09:15:22 -0700 Message-ID: Subject: Re: Prompt dir expansion after removing cwd's parent To: Peter Stephenson Cc: Zsh hackers list Content-Type: text/plain; charset="UTF-8" X-Seq: 50347 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: On Wed, Jun 8, 2022 at 2:42 AM Peter Stephenson wrote: > > > On 08 June 2022 at 10:14 Daniel Shahaf wrote: > > > > With 5.9: With any version of zsh ever, really. > > Ideally I'd like to see some indication that cwd has been deleted, or > > that a path to cwd couldn't be determined, etc.. IMO this happens so seldom that doing it before every prompt as a shell default just seems like a huge waste of time, especially if (say) the current directory is on a networked file system and there may be a significant delay checking it. If you're doing this to yourself often enough to notice, put something in your precmd hooks to discover it. > It looks like prompts currently just passively look at the internal pwd > variable, so make no kind of checks of the environment of any sort. Intentionally so ... > However, it looks like this has wider ramifications as it appears > "pwd" and "pwd -P" both just shrug their shoulders and return > the last known current directory in this case. /* * Try to find the current directory. * If we couldn't work it out internally, fall back to getcwd(). * If it fails, fall back to pwd; if zgetcwd() is being used * to set pwd, pwd should be NULL and we just return ".". */ As of workers/50287, we always fall back to getcwd() rather than "work it out internally", so some of the foregoing may have subtly changed.