Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Jobs unexpectedly disowned
- X-seq: zsh-workers 44562
- From: Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Jobs unexpectedly disowned
- Date: Sun, 21 Jul 2019 08:19:26 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=jJxFGRT+nFVWy1VmZ+lLWD163mxh2CHbdVwRh32s9u0=; b=I+zuBmCFhNoJjNT+ipEz/FMTkrdteb0dnrqkxQZ8z62sWVNAqZsj1zGiiQdC+YuAk4 r0hPtKjtmHtyxATMVrxZUcunFHdha1pGKBSH8CyWObC0SJq+RxAZeN49oRAp5FPDYL2I h19SPHq/PgdlcdMIvX6ICq61V5zO6W53CwrVkxnX6Pqv4J5TOnX+JMpVWIDheWz+Id7u UdHd7xBI/Xa7I+2DrDtKYlh2iGX2fgX/G0XHIB4xjphMtasqOY2d69Ouqbp7SUFBqtEM 2L2iXo4keDoylO4N7dWhpNZ5wKgvgnD1pbkheb3Uz2UtwzPhb2gX9ti0yLTFocgIJYWi 02Kg==
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
I'm seeing weird behavior with jobs getting disowned and I'm not sure
whether it's intended.
Code:
function f1() { sleep 1 & }
function f2() { sleep 1 &; true }
function g1() { f1; jobs; wait }
function g2() { f2; jobs; wait }
echo g1; g1
echo g2; g2
When ran from `zsh -df` I get this:
g1
[2] 31060
[2] + running sleep 1
[2] + done sleep 1
g2
[2] 31061
I expected the output from g2 to look the same as from g1 but it's
different. Somehow the background job gets disowned when f2 returns.
However, this doesn't happen if I call f2 directly instead of going
through g2.
f2; jobs; wait
[2] 31137
[2] + running sleep 1
[2] + done sleep 1
Is this behavior intended?
Roman.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author