Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
detect pipe
- X-seq: zsh-users 26421
- From: Ray Andrews <rayandrews@xxxxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: detect pipe
- Date: Wed, 27 Jan 2021 08:45:24 -0800
- Archived-at: <https://zsh.org/users/26421>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-users/2021-01/e7dc936d-4149-7882-5ac9-24e34b268985%40eastlink.ca>
- List-id: <zsh-users.zsh.org>
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