try to work more intelligently when pseudoterminal output is directed into a pipe :)