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 12993 invoked from network); 17 May 2021 23:15:57 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 17 May 2021 23:15:57 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1621293357; b=V0XRfWE2z8FmruIbbGHrgLN4VjARUXJK8KTU+ejg/+6vK0Ed9tvfcJs6WuPq2cryae1oJ0Z/fv eAFiRkGfJu7bLxqpWHfaS1jMi7iEQr7Y344aDQWufN670k8n6/DnrkSMr8MAHYVQcEnbxiHnwu DlAMPH3+eGQXM+ca0S9IpjDtGTjbmcMZRAenSIPrxjlOiKXsWg4CNtY8L0XqXP8vcS8/EbdLV1 a/6MY5muiBbk/cFde18AlyqZxSVIQoEBEX7e5tU3kQ1Q8+sXPvCEwDQrDz76YAYGBsC851I/xe 2pThL2FAugIU2sFgD1KktAEKY/fTDxowihpku3uCw/HJHA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-oo1-f46.google.com) smtp.remote-ip=209.85.161.46; dkim=pass header.d=brasslantern-com.20150623.gappssmtp.com header.s=20150623 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-20200801; t=1621293357; bh=sjXZgcBPOoTfnzjAVa/AY20TmUAZtAcvtoU4Peo+f9A=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=AvcOgIswrAkzsuhKI7s0EocgJj5Tpx7BCZyo3gOi1qEN0UFG+RPHGM/YcImK7aBmkiSzS1khKQ Iq8UbgH+oFp1RIvfp9gR3mkuVhsjOHXiDekEBMgNSZ2ioCk0TQpOhEagFP2dLMsUKEl3Fs/bna d+RLDSxN6ZYWYnXphld8I3t/l5lSyXxUD1vzBXoa/2wZHPOzxxvVtRUvv4f/05uh8LKS2lekVw gj5aKTGJnG1yP5GtvR2kMk76h6XeVoQ4WI2g7Nc+l5z7J/yCGsEGLUdRgD772NzxVTz9WQPzy4 1IapneZMZs22sJMVCkhiQKYTl+D1kiJNILFTXU94rNW6Ew==; 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-Type:To:Subject:Message-ID: Date:From:In-Reply-To:References:MIME-Version:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=x00+AYdspLwbDNfYMd0KpXwvmZOCnU2bKWsXJt2mApg=; b=LqMDE/eRi7Y4/p3PkdVoSe/Rmr 5AopbAybJ3dgCgtR2XgP0wdM859mCaSMExksiFXsXMoaU9XZt2PEp+gl6XZsav2ytu486sBEuLqxb WLX7dPMeTEwwTazsXCe1AX9e79SiK5DIL+mMf30gf2vf3YsIpdqocxMCatnkjAXoAyzatU1JU7I9n 0HyqGQDOILPZo7bvtFBGAMEBrpDvAZ5U7imR5TDTaqpA4CR3LAZH2KMzfZdRot5RYxcBF8sMfw5+f sViIZqNmVyWi2Du6THU4gcXXTs6xEGa1WABAkEBxXsYXA8RkiVn6oo2hD7cVMKBz6d5jLF1czcAGT QTm8CW4A==; Received: from authenticated user by zero.zsh.org with local id 1limSr-000Ad0-9D; Mon, 17 May 2021 23:15:57 +0000 Authentication-Results: zsh.org; iprev=pass (mail-oo1-f46.google.com) smtp.remote-ip=209.85.161.46; dkim=pass header.d=brasslantern-com.20150623.gappssmtp.com header.s=20150623 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-oo1-f46.google.com ([209.85.161.46]:41665) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1limSX-000AIz-A6; Mon, 17 May 2021 23:15:38 +0000 Received: by mail-oo1-f46.google.com with SMTP id e7-20020a4ad2470000b02902088d0512ceso1828769oos.8 for ; Mon, 17 May 2021 16:15:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=x00+AYdspLwbDNfYMd0KpXwvmZOCnU2bKWsXJt2mApg=; b=FLOkHcO2nlUVXFLnj+aBW0b88RgYKFHF3bmzJ+qf2V66dNyugehCpA9n4vmzZQEOP3 th8kJeKTUXHL6zrtB24vr/h7wzAcZbo8cvXa4tVM43axaHCDjpmXsYI4rFgOK04cQDpC 5GrFsrIhUFhV4qHVgme281n57twSWqLL3ELpeCLHYzLp9JmqTHTEFfb1RBFg9NVKHi0g XIiRoueVTzLjNQEgdfUa//GFXX+N2lBF0ji43EruDXWpwIJCjW8mXQa/JqsGU+SUVuOV KWmhvLfh80UeCwPSpXw/i+PQFZxPtwajLWc0/t/DK3OosD7tNiN513fWTgnGk046TMzQ tZnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=x00+AYdspLwbDNfYMd0KpXwvmZOCnU2bKWsXJt2mApg=; b=KuaVUYfgiWhM+7S+HCI5tMx+OxCsuobyIZ8x2bwJNLLfudiQaMvG4qMElRcyiDakTm /b4WdVyUV24R7h7KDVT8RE34Ueqpsfzk6v+x1T6PlSaqPRIWN0wtE08Z4K1tv39gRNbw +DyNwoys9zjeWFU/huOk40ixq3L+e2Jv4FWJJZ3BWMgn82+V7UYI7DoIwTYrkEIEAIYr s9m3XJkDMJ6qpjv/BVQtWtXML26g+TdHcYKQ/gFNCMf4eORGHlaMWPuCuxZdrATIH52h cvi2H1WACGeDfvBSjTFuzq0qFsrm1fwT2/V+xnyXhxeZD+0wwN9xiHKFJ/SU9jA5AF0O 2zqA== X-Gm-Message-State: AOAM531+Et8xXQlF7KXukV3CLVoGsGwZ8CuRvWTf5ieofl2KAYI4NcsE VUc3yBzCyf5vJVXEC3DsU23qh5u6TcrrA4hFtr26PiV0K0xeiA== X-Google-Smtp-Source: ABdhPJxdKogKTjC4zL0ypcOCBJmjx7hKx3HisxwQHic/7zBPP56mmq7XSO2MMdeHUcRU1MgsCm5hiVyQs0nZq43YK5E= X-Received: by 2002:a4a:c446:: with SMTP id h6mr1838456ooq.82.1621293335777; Mon, 17 May 2021 16:15:35 -0700 (PDT) MIME-Version: 1.0 References: <20210516152418.GA39669@zira.vinc17.org> <20210517202608.GA3255290@zira.vinc17.org> In-Reply-To: From: Bart Schaefer Date: Mon, 17 May 2021 16:15:24 -0700 Message-ID: Subject: Re: $PPID not updated when the PPID changes (parent killed) To: Zsh hackers list Content-Type: text/plain; charset="UTF-8" X-Seq: 48868 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 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? > 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. 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.