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

broken pipe with prompt -h



In attempts to counter my previous foolishness for initially making
'8bit' the default display mode for my adam2 prompt, and then swapping
it around so that 'plain' is the default, I've found myself wanting to
check from within my .zshrc which version of adam2 is available in the
installed zsh:

  $ prompt -h adam2 | grep -q 8bit

However, due to some signal-trapping related funniness, if grep finds
a match early enough, set_prompt gets a SIGPIPE:

  $ prompt -h adam2 | grep -q plain
  set_prompt:52: write error: broken pipe
  set_prompt:53: write error: broken pipe

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.  Can
anyone please tell me the correct fix?



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