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

detect pipe



I have a function that as used this test for piping quite reliably:

    if [ ! -t 0 ]; then

... but today it stopped working.  I thought I might have broken something in the function so tried backups and it would flicker in and out of effect, work one time and not the next.  Searching the web I see that apparently the above test is not 100% reliable. True?  If so, is there a better way?  This is probably not strictly a zsh problem but the randomness of it working intermittently suggests some time lag or delay or something. Perhaps the test needs time to think?  Someone might have a workaround even if this isn't zsh's fault.





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