Note that it's not only upon ENOSPC, EPIPE will do as well: $ yes | (trap '' PIPE; tr a b) | : zsh: broken pipe yes | zsh: segmentation fault ( trap '' PIPE; tr a b; )