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.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,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 22137 invoked from network); 8 Jun 2022 09:42:23 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 8 Jun 2022 09:42:23 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1654681343; b=RfjkhvpVIdd/a6jV3nRiGFo3SnYUAXbuZ/WvUpqPrHPWFQZACgHlILmXH3T+Y7+N8kOJKe6Nlq EyHBDStZP3HQAbOqEVM5XWp1dt3rAECZA1JIMJ2h/x0jVLc8hNSap8tTDSkWQa4jeNg6h8IHta TdMFIeLvgWFeNzKpj7/Iqg2LCToabEtDo6GuSnHrhNpNHlCFn5Ndn0YHUfvRNqXUiVkGlZZO8+ g5KrMhrulIGypR7QWYl6xssuhBrfs02AX79uQsd5TZp7U12s3eWCrWzBrCVpBPjX7yGdPzWFIi xbvHcTUEeLOEaXDA2joOQos9kJ5xLgKmsD4UFjUMcT3U6w==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (smtpq1.tb.ukmail.iss.as9143.net) smtp.remote-ip=212.54.57.96; dkim=pass header.d=ntlworld.com header.s=meg.feb2017 header.a=rsa-sha256; dmarc=pass header.from=ntlworld.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1654681343; bh=1sTNx0nR7sOCU9ISg2qUT2j2d6sXjPXzFY4bGw8qyWU=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject: References:In-Reply-To:Message-ID:To:From:Date:DKIM-Signature: DKIM-Signature; b=DJpMjvAk2yXdcgt4kUQBJPsnGluT2znxLblPw8eZW66uZJ/TOvNnYtL0tZ68hH9XGxXKzXT5k6 c5wW6srtiWDMwo/pfOGmhC4oLrSqbwr6kf8HfGwQqJLIpiYA5GJlYjKg0/7LFJCLgD5DemYEuZ ybi810c9iw61B0KSNsaDPvtWnPD2QHYiz6eNWWZKziQ/OX4JGlnUDP7fRwBUKrqJlqvX6DsanA mOovrxCP29zBKJottogrjbvcMOc4iJtlbfaFuxOEkbV7YvDcLLTQKA9oricZPOhO3RxxcOfPto DB+W5wQ2C9qZck6gVxRw7LWpMKBsT7gxpy/JXEdxNy/eIw==; 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-Transfer-Encoding: Content-Type:MIME-Version:Subject:References:In-Reply-To:Message-ID:To:From: Date:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=yHblY5WDN5JlPu/ZkeRMCqmZkc6MZDcrgiHMoSCzgwY=; b=Jv0swnTszkVfzUMWDISOA/D8am N2YzxNTXnW/CTTvttOQbpsBj7JfCwfjQoiMIfyQiafkkb+lpO/UH+Rf9NFIT5aqTS6sKme+Ed8ihE DDA5m75YwUVXBTUWf9cLH5XQOg695n7sOcTmXDK9nDYyEDQpRL92/tfE1p2WaTx7yubpWjCeQ7eLm r+LzCINhvSIQB43wOGTcIFs205VHJDuJ7atvOr09bXYjHwBp1NwTtpWHlr5NZoPgPC61nowDP+uMO nILFHkXB3OExr7oWunP4JuVpXGo4qj3Y1qCnU5TzSHzo7VMdScj4A3cRasoMfsUw8OzDbm0VXl3LX buYCuiJg==; Received: from authenticated user by zero.zsh.org with local id 1nysCl-000Bjc-1h; Wed, 08 Jun 2022 09:42:23 +0000 Authentication-Results: zsh.org; iprev=pass (smtpq1.tb.ukmail.iss.as9143.net) smtp.remote-ip=212.54.57.96; dkim=pass header.d=ntlworld.com header.s=meg.feb2017 header.a=rsa-sha256; dmarc=pass header.from=ntlworld.com; arc=none Received: from smtpq1.tb.ukmail.iss.as9143.net ([212.54.57.96]:42744) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) id 1nysCO-000BOY-Kb; Wed, 08 Jun 2022 09:42:01 +0000 Received: from [212.54.57.80] (helo=smtp1.tb.ukmail.iss.as9143.net) by smtpq1.tb.ukmail.iss.as9143.net with esmtp (Exim 4.90_1) (envelope-from ) id 1nysCN-00060J-VI for zsh-workers@zsh.org; Wed, 08 Jun 2022 11:42:00 +0200 Received: from oxbe13.tb.ukmail.iss.as9143.net ([172.25.160.144]) by smtp1.tb.ukmail.iss.as9143.net with ESMTP id ysCNnRT5OVu5XysCNn4wo1; Wed, 08 Jun 2022 11:41:59 +0200 X-Env-Mailfrom: p.w.stephenson@ntlworld.com X-Env-Rcptto: zsh-workers@zsh.org X-SourceIP: 172.25.160.144 X-CNFS-Analysis: v=2.4 cv=LNR1/ba9 c=1 sm=1 tr=0 ts=62a06ee7 cx=a_exe a=wuFMYA7voKp1dZz7Z+vj5Q==:117 a=I_Av47A-8eYA:10 a=IkcTkHD0fZMA:10 a=vinPr5In5y8A:10 a=IkK_8T8dv-RVFkXmGOIA:9 a=QEXdDO2ut3YA:10 X-Authenticated-Sender: p.w.stephenson@ntlworld.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ntlworld.com; s=meg.feb2017; t=1654681319; bh=1sTNx0nR7sOCU9ISg2qUT2j2d6sXjPXzFY4bGw8qyWU=; h=Date:From:To:In-Reply-To:References:Subject; b=2dG0EJP+FIocGEb8ILSWIrPFcTYXihDLmcCL0N1wcEpCJ+nlp0Rp7NClueKYS6+WG NKCKjUbMiUBZ2wr8DZ3AAPXOzuCthnXz2Zr7XAtJfzNenY1EONtQcidE38VapR7PEe ONAOEE82HgYiX6LADTH8Sz7XYT/5PRHgWedF2e7D5rH0gnUfMWtOAOCe0jCkNKjJdp ddg3dEJntj04Ei2fV+zmRQ18Ik0XR5xmrKVSKyGZA5AQrEJhkrs1vuUsLJeXdqDlJL JyA0e090+E4DecQ+GpboxtrxEJN6GLdVIetaKxSHONFzwvInHPGZ1DWolQEnx55i8s ixvsO5JUthF/w== Date: Wed, 8 Jun 2022 10:41:59 +0100 (BST) From: Peter Stephenson To: zsh-workers@zsh.org Message-ID: <1644026654.700770.1654681319674@mail2.virginmedia.com> In-Reply-To: <20220608091426.GA15730@tarpaulin.shahaf.local2> References: <20220608091426.GA15730@tarpaulin.shahaf.local2> Subject: Re: Prompt dir expansion after removing cwd's parent MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Priority: 3 Importance: Medium X-Mailer: Open-Xchange Mailer v7.8.4-Rev72 X-Originating-IP: 165.225.17.146 X-Originating-Client: open-xchange-appsuite X-CMAE-Envelope: MS4xfJSCN23a2nwRMNFg5jG+hiD+SYlH6Xl5SvuQOkVQNwg7rcpfFXUEU/DyZ63v/q34lpLf3shoECPupo90ZOSp1+1leb1h39W55AmykARLH1S4dMZrCYyU pvc4ZQkBs7aQDL65MqjmvErIXDEgegKEane5hap3FL9NbJ1pU0P/R6qvmzxlna9gycJDwjfj06484WKqWoFPbyEfFbXtuNLezabL8G+AuUQB2vcESSZb40SG X-Seq: 50346 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 08 June 2022 at 10:14 Daniel Shahaf wrote: > > > With 5.9: > > 1 % cd /tmp > 2 % PS1='%~%# ' > 3 /tmp% mkdir foo foo/bar > 4 /tmp% cd foo/bar > 5 /tmp/foo/bar% rm -rf /tmp/foo > 6 /tmp/foo/bar% cd .. > 7 /tmp/foo/bar% cd .. > 8 /tmp% > > The prompts on lines 6 and 7 are wrong. > > Ideally I'd like to see some indication that cwd has been deleted, or > that a path to cwd couldn't be determined, etc.. Definitely not some > apprently-valid path that points to something else than cwd. 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. Presumably a getcwd() is needed each time the prompt is updated. We also need to decide how to signal this. 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. For both, bash gives the more logical pwd: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory pws