From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id f065d15d for ; Wed, 31 Jul 2019 14:37:39 +0000 (UTC) Received: (qmail 1805 invoked by alias); 31 Jul 2019 14:37:31 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: List-Unsubscribe: X-Seq: 24119 Received: (qmail 2060 invoked by uid 1010); 31 Jul 2019 14:37:31 -0000 X-Qmail-Scanner-Diagnostics: from mail-io1-f46.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.101.2/25524. spamassassin: 3.4.2. Clear:RC:0(209.85.166.46):SA:0(-2.0/5.0):. Processed in 0.88209 secs); 31 Jul 2019 14:37:31 -0000 X-Envelope-From: roman.perepelitsa@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.166.46 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=IIAyHCXYbgYA4U/mII9QJJJ9KIG34kAqy7N00A/8hGw=; b=n1Ka7TG074snw+BVKubKkdkxYLzjjKuw/d3KhtkkcwuncpWd3xrpFd8WzTdzH0mswk FCtD166R+K8sdoPcoHTx79jhv4ww7ddxkul8aBFaDPozrTp+GBE2vB1rKZp9jzKNeRL8 40QFvPqx3nKdT0OoJm5ROcWrElM7LdDGWtT+cfgaQ0RvQHV4MyNMIf/cQBSq8C2ZnyMh kUt9y0rpLIfnkayVhPx+y2Qfo0HgFLtjYnFyo4GNzxjU+riCtwwiU402MYYTtXLVUqAa cQTQsHm/he4mYD4Z5XqrGNWbGy6l3GYkuQRrN5TaVBobmJR+TWXZ4AmAhMhXRW037Dcv /i0g== 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=IIAyHCXYbgYA4U/mII9QJJJ9KIG34kAqy7N00A/8hGw=; b=WcmUvwsI51PiCisn9r75BUXxYrczRuxzRk6h45PwKSyZuFxtLQfzlB5o29tIkcvewm AE9fwJyL/CM4NVz2uFyb42P0vo+E/wsFsEBWzrp2LiWKeVor+1xc8gzmvug5Pcr+Z2Go HNjr2w3U1KqRuNYUFqQc3kh0hZwFsp/rjZiFtINdrMtE/4F/S/RCZI8qt0fBTtoOSXcp wuabY2c4+KhjEWwOiP6OTZN3naQELlzlvEDJJQieq7gnMe6iRHSK/NKZ6STz+fIgM5RT DI35pUs9SOCmPrW9wiBKj4UvOIqh6pAkWhmDhvjVzaoP5EY1ArwlZ49uBlZEHNbZahas Hq0A== X-Gm-Message-State: APjAAAVxPSwfiTraTykNdFwbILqZO7bBM3Tq8eFccKlbnXzZ5dpQLQFA cwxQGsZZKsnz6xsQRXHDGK1hUkecRZ0bOaJbpX3qHUW2Va8= X-Google-Smtp-Source: APXvYqw8//dTjXtspQMAGbEafv7jRfLwVJWSkrfiPyBowsP6gZzJnzF+U/Z4e/TOucAFoooY15dS3AvDxcXkN1jqNK4= X-Received: by 2002:a5e:db0a:: with SMTP id q10mr26133964iop.168.1564583817563; Wed, 31 Jul 2019 07:36:57 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Roman Perepelitsa Date: Wed, 31 Jul 2019 16:36:45 +0200 Message-ID: Subject: Re: status and pipestatus To: Zsh Users Content-Type: text/plain; charset="UTF-8" In case anyone with the same question finds this thread in the future, here's how I believe status and pipestatus behave. Every time pipestatus is updated, status is also updated. Most of the time when status is updated, pipestatus is also updated, but there are exceptions. In general, it's not possible to determine whether status has been updated after the last pipestatus update but by hooking preexec and zle-line-end it's possible to do this almost all the time. The reason I've started digging into this is that I'm maintaining ZSH code that shows status of the last command in the prompt. If the last command was a pipeline, it shows status for every command in it. Or it should. I noticed that sometimes it shows pipestatus not from the last command and went down the rabbit hole. If you are defining your own prompt, don't attempt to provide this feature as it doesn't seem possible to do so reliably. Roman.