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,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 10032 invoked from network); 18 May 2021 08:16:59 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 18 May 2021 08:16:59 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1621325819; b=lK9T8S+SMpxRUlJVoQcrxP//n4DdEfnwPOo9QbB1+cg70FjkBm7MYOfnxh4rOJaAJ6rPZTXB9l +WgTX5AIJX0Gi8cYd5fYEpFs2uwmPXuI9NLMHp0qbBZ1ChRW4pEBsMKCH1zTRWP1MkNkK5BXRf SG0kea/YwCIG6bgLHgm0KYW2JS7S4v2Aju0uMJFf+ErNbObPd1vLC5HsypQR8MFzgDFF/UqdSE raRtTm7UL9RDuF9/ZQdeIhK7aWt+QKHUZHU9wwOykdN1uXpYMO+pLtBIt+OLkcQ1e6dPUTrZqu uOBcS9B2zk0ji+z6As2D+oeqYSI8ehdWzNZuvnguraJRsQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (joooj.vinc17.net) smtp.remote-ip=155.133.131.76; dmarc=none header.from=vinc17.net; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1621325819; bh=AhLVNPBH7C/lPOBQ4C74pbAw3uEJ9u/6vyDzmbWT9W4=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:In-Reply-To:Content-Transfer-Encoding:Content-Type: MIME-Version:References:Message-ID:Subject:To:From:Date:DKIM-Signature; b=RnEGVCa80GaTQgQ+W6Utgi2DX6tUp+Ep8g9Va11QuCELX/alenFSfBPzgoy9ILcUsgbDoPJ2vE LJHKISwpj8yXQDmmzRh2wSrnJr6Jw9w0wLurzSuDscwU28QXFm4O6wm6vEm5NA6jR67djOW6w8 WZjOJuD0uzH3Rubo5CbNLJSdNDozC/dpq8PT7YVHqemN+JoCmGNslLZ0yFnkE+/NLqsgKlyjpH NnBQJF9A7QQF+6jy7JOzg9LXD2V8FLbDFH/NsIQwb92Oa9idaZwwsYvQLzpIDYWkk5wa4DWSYp BhGIm9gr+cJbfGAL+iz99ao1uGoZv/Vu+6sS1l8yya6nng==; 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:In-Reply-To:Content-Transfer-Encoding :Content-Type:MIME-Version:References:Message-ID:Subject:To:From:Date: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=9Cfy2zARS1Aodc7z9cM7jfOZsrFQ4Jxd15BojDhb+AA=; b=aDrgxx+eorIEbmvNyNuSl0Bogt HtvY9qaa4exJc60B43nn/EwEBYbypplkfyhwMIQWsNHoPIMXw/OZ7EMxQY6dX0HzXu4t3WpAU4FkF Dz4T9pG2niXaQEBtLcuP0qS0aI44r3fw8qPza4PCphHZaLn7xJiw1Lqfb+7R8ihh2+jpfab0jST/P 8mDPKfm9fxbMZkbyv6CLS1sydcxIvzWBN/hh8JlQ504bjQ7bLDKFYj6vaX0id0KvyPzIzBnADlhbV 7Wya/nVnzYaUtW2yc0Dp5FXPxRl2nkHC80N3XWFRcE6tHihsMWDRY/wS6VDQ7rgP6IdDj1gsPpYn5 YneUs+/A==; Received: from authenticated user by zero.zsh.org with local id 1liuuP-0004dU-Ss; Tue, 18 May 2021 08:16:57 +0000 Authentication-Results: zsh.org; iprev=pass (joooj.vinc17.net) smtp.remote-ip=155.133.131.76; dmarc=none header.from=vinc17.net; arc=none Received: from joooj.vinc17.net ([155.133.131.76]:35626) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1liuss-00039X-EL; Tue, 18 May 2021 08:15:23 +0000 Received: from smtp-zira.vinc17.net (128.119.75.86.rev.sfr.net [86.75.119.128]) by joooj.vinc17.net (Postfix) with ESMTPSA id 48B02DE; Tue, 18 May 2021 10:15:21 +0200 (CEST) Received: by zira.vinc17.org (Postfix, from userid 1000) id 0BEA4C22229; Tue, 18 May 2021 10:15:21 +0200 (CEST) Date: Tue, 18 May 2021 10:15:20 +0200 From: Vincent Lefevre To: zsh-workers@zsh.org Subject: Re: $PPID not updated when the PPID changes (parent killed) Message-ID: <20210518081520.GA3332066@zira.vinc17.org> Mail-Followup-To: zsh-workers@zsh.org References: <20210516152418.GA39669@zira.vinc17.org> <20210517202608.GA3255290@zira.vinc17.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Mailer-Info: https://www.vinc17.net/mutt/ User-Agent: Mutt/2.0.7+174 (4c786d87) vl-137001 (2021-05-15) X-Seq: 48875 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 2021-05-17 16:15:24 -0700, Bart Schaefer wrote: > On Mon, May 17, 2021 at 3:27 PM Phil Pennock > wrote: > > > > The initial parent process ID; that is, the process ID of the process > > which created this shell process, at the time that it did so. > > This is pretty close to what I was thinking. Does "at the time" > really add anything? It would be better without it. > > Just as for $$, the value is only set for the original shell and does > > not dynamically change for implicit subshells (as created for (list) > > and for pipelines). > > Except (list) is an explicit subshell, isn't it? > > > It's an attempt to be clearer that "if you run zsh within zsh, > > that's not a subshell, sure _that_ gets $$ and $PPID reset". > > Indeed. I'm tempted to say > > Just as with $$, the value is updated only within a new shell > that increases $SHLVL, and not in other subshells. > > And then clarify "a new shell" under SHLVL if necessary, but I hope it isn't. The zsh man pages use "subshell" at various places. They should be consistent on what a subshell is, perhaps have a clear definition at one place, and say what happens when a subshell is created. Note also that the following in the zshmodules(1) man page should be updated too: sysparams A readonly associative array. The keys are: [...] ppid Returns the process ID of the parent of the current process, even in subshells. Compare $PPID, which returns the process ID of the parent of the main shell process. This is even more confusing, because there are actually 2 differences between $sysparams[ppid] and $PPID: 1. The fact that $sysparams[ppid] takes a new value in subshells, but not $PPID. 2. The fact that $sysparams[ppid] is updated when the parent process terminates, but not $PPID. -- Vincent Lefèvre - Web: 100% accessible validated (X)HTML - Blog: Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)