On Sun, Nov 6, 2022 at 7:50 PM Bart Schaefer wrote: > > More questionable are the looping constructs. I can't come up with a > way to have the loop end in an error state without the whole shell > ERREXITing before reaching the end of the loop body. Found the way (and it should have been obvious): repeat 1; do false && true; done The statement `false && true` doesn't itself cause an exit, but does become $? of the loop. Now the weird bit is that the attached patch DOES NOT cause a slew of test failures in C03traps. E.g. if I run this test standalone: Src/zsh -f =(<<<"(setopt err_exit if true; then false fi print OK )") I get no output and $? = 1. The exact same code in C03traps.ztst prints OK, which it should not. The only difference I can see is that ZTST_execchunk fiddles with localloops, but I've tried doing that too. There is the question of why ignoring a false status at the end of a complex command has so far been considered correct for ERR_EXIT, according to C03. This is a disagreement with e.g. bash.