Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: status and pipestatus
- X-seq: zsh-users 24119
- From: Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: status and pipestatus
- Date: Wed, 31 Jul 2019 16:36:45 +0200
- 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==
- In-reply-to: <CAN=4vMro0WQBvze1jTFy2zyVxVng99qdHCr0pDcKjZrYm189gg@mail.gmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CAN=4vMpGHeXqLFkMpfzZyYr8=GScFymvDSwsUsvJpNipdkJ_nA@mail.gmail.com> <CAN=4vMro0WQBvze1jTFy2zyVxVng99qdHCr0pDcKjZrYm189gg@mail.gmail.com>
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.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author