mklabs/node-tabtab — pull request #4 by malandrew (2013-09-18 00:34:15+00:00)
Title: Catching EPIPE error caused by `source` closing file descriptor before reading it

Just added the same lines that isaacs has in completion.js to catch the EPIPE error caused by using console.log or process.stdout.write in a subshell used for process substitution.

Near as I can tell the only way to make this work on OS X is to ask the user to:

$ pkgname completion > /usr/local/etc/bash_completion.d/pkgname.bash
$ echo "source /usr/local/etc/bash_completion.d/pkgname.bash" >> .bashrc

I'm trying to find out if there is an alternate bash syntax for use in .bashrc that will keep the file descriptor open long enough to `source` from it.