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,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 31093 invoked from network); 18 May 2021 16:15:08 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 18 May 2021 16:15:08 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1621354508; b=YhYVAdxu97wgetajngJVyzMCNKXSYmY5vm2JIG58AWQFM7Cty9Msf40vMyFjFg4mRTYhRE4mpt r2pVJdwAWs8k6XJmtb3Q36EgNdmh/1sQURkLBnI6hL7ws3/hiUCjwB7eMe6ycciOVlb9pSufkR /X/LY/1vpf6rZ3YKdOhiDSQ4RYKIGJN/9d+BiGAHFGclg7pjxQI/qay7y28ME1ErvwC46cje9B iXyxx4qz3nAXW7Ucv1dju9CCzX3vv3jM1uH37w/2D7HVluK0zyuKV88Qv8C5yYpq4YQ4AvKIP1 LsRQzjQsVJWMtz54w34tEXRYPzrdwD4+8Wvd1gOfhAGC+Q==; 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-20200801; t=1621354508; bh=HQgPuB7uDD708v016hViyYya/nIBl/8bxKm8SlDb2+A=; 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=sxD7DgFEGEuHViHm3bl6uj9pw4F82D70QOYtVJqfMOxPM9v6eTCLcR+zoillJ5aibFRJexcNhJ UcyNUQtc8ubNRLnzjbFovFqG9gTpOJBpbBikzSj71qQPskkuAcN/BMZQpH5VN/eVUQ+m/+ni2I wqobVZ4GZ0RGCtlo25Dfnbfs3d/SljczBVfHf/W8BdAeDJFQUv9PEh/+ALfU3TBfkvngajjBMv VzMV/bhW1x3sAe5oPCK7e86WIEN5G+J1ngSUJb5cFlm/VwoSyrfL/IPusvM/aJfX8ejJXasiUL X2RYVsAQfzNfVHCVCi9lCCGoRY+pMJjW7mmzLRP1OI0gqA==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20200801; 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=53g6CBXwY10NM+fjShAHerVQR/L5pEs7a5MN2JO4N4w=; b=GOX2IYqfj/EIDoh4vJlFaU7ulW NuP7B0Gm8v2dm4ez2W0jvp7aiFsTLFxEZ5Ew2noSRxPq/75pC4FZfI5zxhtR8uztPM4iv8ZOMmF2R cN+WkQ3ZGmd/vij2ut58yAPfrWZ2h7kLmoZinW7mLUsIZlCw+QggBc6tQj7+rQuIzXmwhXN10R8VQ HQB7KKE+MBngxBpHVFtQ2oDZBTBBvlNsYKKycNQfVDWcBKvTIeiJowJjhtHMSnnlxob1wztKsdcqw jrEMjyFyaMY3Pd2cJbSM6/UrPULyzQM3kdh3OkogGvSNSvz9YeatuOEhcl5OxWgJ7mKW+GCG5gb8k nDvSFdjg==; Received: from authenticated user by zero.zsh.org with local id 1lj2N9-000Jpb-NA; Tue, 18 May 2021 16:15:07 +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]:38966) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) id 1lj2Mx-000JVw-KR; Tue, 18 May 2021 16:14:56 +0000 Received: from [212.54.57.82] (helo=smtp3.tb.ukmail.iss.as9143.net) by smtpq1.tb.ukmail.iss.as9143.net with esmtp (Exim 4.86_2) (envelope-from ) id 1lj2Mx-0005hg-2o for zsh-workers@zsh.org; Tue, 18 May 2021 18:14:55 +0200 Received: from oxbe8.tb.ukmail.iss.as9143.net ([172.25.160.139]) by smtp3.tb.ukmail.iss.as9143.net with ESMTP id j2MwlMeVkAxkSj2Mxl4xbR; Tue, 18 May 2021 18:14:55 +0200 X-Env-Mailfrom: p.w.stephenson@ntlworld.com X-Env-Rcptto: zsh-workers@zsh.org X-SourceIP: 172.25.160.139 X-CNFS-Analysis: v=2.4 cv=PMZsRdmC c=1 sm=1 tr=0 ts=60a3e7ff cx=a_exe a=pgSR3NrKiwmx/6vnWRL19w==:117 a=jNT6hqU-TeQA:10 a=IkcTkHD0fZMA:10 a=u-IBiUmKOg4A:10 a=pGLkceISAAAA:8 a=q2GGsy2AAAAA:8 a=jplFcdf6-8fI4vbmU9AA:9 a=QEXdDO2ut3YA:10 a=z9dJwno5l634igLiVhy-:22 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=1621354495; bh=HQgPuB7uDD708v016hViyYya/nIBl/8bxKm8SlDb2+A=; h=Date:From:To:In-Reply-To:References:Subject; b=y3nHl0UnGTTwaxAkJ+ahzuFYbkJLBBO47aVNVWoSIkJ3cQp0+TS1a4kw5yCL4zbOO H1LR7Y4T+mObQ3/FQyYoC5UFxkbfwK919n46F3lhxuMDPfW5P8hU6vgTn47IHg6WUZ TfH3xbBka7k+wFYEkAWQvtfh55lDZIZRe6/nArtiJOyN1Tr3tTTlnuZXZblKeKZdRB bFJd/DvotR4Kjp5TKBuWDig+ReZbell8naaIs/QEFY+vSgun5+iH6++/BG6UZdUoeY QEx3OuXa5ynOFWpwWbJuuvZFYkDaO2sUJNuPt5vfQ9Eh6oH3uwVbnMKDnACcdCaPQ0 8y4DP8n0ecP3Q== Date: Tue, 18 May 2021 17:14:54 +0100 (BST) From: Peter Stephenson To: Zsh hackers list Message-ID: <2130274784.211534.1621354494808@mail2.virginmedia.com> In-Reply-To: References: <20210516152418.GA39669@zira.vinc17.org> <20210517202608.GA3255290@zira.vinc17.org> Subject: Re: $PPID not updated when the PPID changes (parent killed) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Priority: 3 Importance: Medium X-Originating-Client: open-xchange-appsuite X-Originating-IP: 172.25.161.11 X-Mailer: Open-Xchange Mailer v7.8.4-Rev72 X-CMAE-Envelope: MS4xfC9HipJvlFoR0zu4pHMO457GWK9Jn9mmz6j92DqAVFDVoWbGFgSG5QkFG8XbQmjqsH7BGp8T1BkSJfcaWsSeOfUEc8ao+XVfxEm+HV/5fP66w8cZA+9W 7EY2bCrD4htdTYu7rF+e5MFPeYLON6wTDIs8IIGh9TOATpuR7akOL+vo6cceHkS2os1jRccRGwWb8IYPCSAwNnPUjeQk5foxfq4JY0C752n02h32mlTMGvXY X-Seq: 48880 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 18 May 2021 at 16:18 Mikael Magnusson wrote: > On 5/18/21, Bart Schaefer wrote: > > Aside, it's a bit odd that SHLVL isn't read-only. Even assorted Bash > > tutorials found by online search treat it as immutable (statements > > like "$dog is only available at SHLVL 2") despite that it can be > > arbitrarily messed with. > > I sometimes set it (in practice only to the empty string), such that > the first shell in a new terminal always ends up with SHLVL=1 (my > prompt hilights when it is non-1 so that i know i can safely exit > without having the terminal be closed, eg while testing new zsh builds > or other things where i want a temporary shell state). I also do some > window manager development so things like "SHLVL= openbox --replace" > tend to happen as well. I do similar stuff to the extent of resetting SHLVL to zero, but I think there is actually a logical argument for being able to adjust it, i.e. set it rather than reset it, if you happen to know that's going to have a useful effect. For example, if SHLVL=1 before a terminal emulator starts because there's a shell that spawned the window initialisation (this used to be a lot more common way back when), then it's 2 in your terminal. It would be quite natural to start a new terminal (actually forked from the current one, but logically at the same level as far as the user is concerned) prefixed with: SHLVL=$(( SHLVL - 1 )) Then your init files in the new terminal behave as they do in the one you're in. I'm certainly not saying this is the absolute one true way of doing things, only that I don't think it should be excluded. It's fairly low level; I think it's a case of giving enough rope etc. I don't think we have any expectation of or guidance on what people do with this anyway. pws