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

Re: detect pipe



On 2021-01-28 7:05 a.m., Ray Andrews wrote:

Delays of some sort are part of this almost for sure.  As it was, the test for the pipe was a hundred lines down in my function.  If I simplify the alias and move the pipe test  to the top of the function:

#alias g='tabs -4; noglob _g'
alias g='noglob _g'
function _g ()
{
local ppipe_flag=
[[ -p /dev/fd/0 ]] && ppipe_flag=1

... reliability increases to maybe 80%.  Still, if I pipe directly into  ' _g ', bypassing the alias, reliability is 100%.  As for test1 and test2 from last night, they are both 100% right now. Thursday's are lucky.    Funny thing, if  ' g '  works ten times, then breaks, once it's broke, it stays broke, I can run it ten more times and it won't fix itself.  Something changes in the OS I think.






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