Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: zargs parallelization support blows up with |&



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



Messages sorted by: Reverse Date, Date, Thread, Author