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

Re: broken pipe with prompt -h

On Jun 29, 12:34pm, Adam Spiers wrote:
} Subject: broken pipe with prompt -h
}   $ prompt -h adam2 | grep -q plain
}   set_prompt:52: write error: broken pipe
}   set_prompt:53: write error: broken pipe

This is a result of the changes in zsh-workers/16503 to cause bin_print()
to report write errors.  There was a follow-on patch in 16556 to suppress
the errors when stdout is closed.  EPIPE might be another error worthy of

} I tried to fix this with a
}   trap '' PIPE
} just after the 'setopt localtraps' in set_prompt and in various other
} places, but it only occasionally works, which is very curious.

Trapping SIGPIPE doesn't prevent errno from being set to EPIPE on the
write failure, it just prevents the process from getting signaled when
the EPIPE occurs.

} Can anyone please tell me the correct fix?

Other than redirecting stderr, I don't think there is one.  It'd be the
right idea to do	trap 'ERRNO=0' PIPE	but ERRNO is read-only.

Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   

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