Hi, I'm seeing zargs with -P intermittently fail with in zsh 5.9 in macOS. Here's the information I could gather so far.
Minimal reproducible example:
% f() { curl -Sso /dev/null 'https://example.com'; return 0 }
% autoload -Uz zargs
% setopt xtrace
% zargs -n 1 -P 0 -- {1..13} -- f
Expected the status code to be 0. Most of the times I get 123 instead. The xtrace output shows:
+(eval):6> case 19 (<1-125>|128)
+(eval):8> ret=123
at least once, even though f always returned 0. Added the extra return 0 in f to force that return code.
If f is simplified, I don't see the error. If the -P 0 is removed, I don't see the error. If the range is shortened, the error will be less frequent. Even with {1..13} it happens to sometimes succeed in my Mid 2015 2.2 GHz Quad-Core Intel Core i7.
This is not reproducible with earlier versions of zsh or with the /bin/zsh bundled with macOS (zsh version 5.8.1 in macOS 12.4). This is reproducible with zsh 5.9 installed both via homebrew or macports. This is so far not reproducible in other OSs.
Information comes from https://github.com/Homebrew/homebrew-core/issues/101937 and https://github.com/zimfw/zimfw/discussions/459.
Kind regards,
Eric