In zsh-workers 27648 and 27650 (commit 8ac97f33, back in 2010), the "repeat" reserved word was disabled when zsh starts in any emulation mode, to avoid interfering with sh scripts when zsh is invoked as sh. (Note that this change disabled the (t)csh-style 'repeat' loop even if zsh is invoked as csh. It seems unlikely that was intended.) Meanwhile, I've identified five other reserved words that are unique to zsh *and* are perfectly plausible function names, so could kill an sh or ksh/bash script: end float foreach integer nocorrect So I think they (and 'repeat') should be disabled if zsh is invoked in sh or ksh emulation mode. 'float' and 'integer' are part of the typeset family, so the underlying builtins would be exposed. It would then be inconsistent not to do the same with the rest of the typeset family: declare export local readonly typeset Thankfully, the KSH_TYPESET option still works. It should revert to being automatically enabled for ksh emulation and not for sh emulation, as in zsh up to 5.0.8. Treating the whole typeset family as builtins subject to KSH_TYPESET actually increases the accuracy of sh and ksh emulation modes. One issue is that POSIX explicitly specifies 'export' and 'readonly' as special builtins and not as reserved words. So POSIX scripts should be able to override them at least with an alias.[*] This breaks if they are reserved words. For the incomplete csh emulation mode (does anyone actually use this?) it's probably not worth bothering to disable anything, so instead of testing for !EMULATION(EMULATE_ZSH) we should test for EMULATION(EMULATE_SH) || EMULATION(EMULATE_KSH). This restores 'repeat' when zsh is invoked as csh. By the way, contrary to claims in the documentation, the KSH_TYPESET option was never completely obsolete. Even with the post-5.0.8 reserved word interface activated, the behaviour of MAGIC_EQUAL_SUBST still takes KSH_TYPESET into account. Thanks, - Martijn [*] This is useful if a sh script needs to parse the output of 'export -p' (or 'readonly -p'). It is not possible to grep their output reliably as entries may contain newlines. The only reliable POSIX way is to have the shell parse it, which is done by temporarily aliasing 'export' to a handler shell function and doing an 'eval "$(export -p)"'.