zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@zsh.org
Subject: Re: zargs parallelization support blows up with |&
Date: Mon, 27 Jul 2015 09:37:27 -0700	[thread overview]
Message-ID: <150727093727.ZM6467@torch.brasslantern.com> (raw)
In-Reply-To: <150727091512.ZM6365@torch.brasslantern.com>

On Jul 27,  9:15am, Bart Schaefer wrote:
}
} The problem is that when you append a pipe to the end, zargs ends up
} as a subshell, and you can't do job control in a subshell (which you
} would have seen if you weren't grepping stderr):
} 
} (eval):wait:1: can't manipulate jobs in subshell

This turned out to be easier to fix than I expected:

diff --git a/Functions/Misc/zargs b/Functions/Misc/zargs
index 71fd428..28ebca7 100644
--- a/Functions/Misc/zargs
+++ b/Functions/Misc/zargs
@@ -73,7 +73,7 @@
 emulate -L zsh || return 1
 local -a opts eof n s l P i
 
-local ZARGS_VERSION="1.4"
+local ZARGS_VERSION="1.5"
 
 if zparseopts -a opts -D -- \
 	-eof::=eof e::=eof \
@@ -254,7 +254,7 @@ then
     bg='&'
     if zmodload -i zsh/parameter 2>/dev/null
     then
-	wait='wait %${(k)^jobstates[(R)running:*]}'
+	wait='wait ${${jobstates[(R)running:*]/#*:/}/%=*/}'
     else
 	wait='wait'
     fi


  reply	other threads:[~2015-07-27 16:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-27  9:36 Dima Kogan
2015-07-27 16:15 ` Bart Schaefer
2015-07-27 16:37   ` Bart Schaefer [this message]
2015-07-27 18:19     ` Dima Kogan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=150727093727.ZM6467@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).