Re: [PATCH] zsh_eval_context: add math context

Jun T <[email protected]> Tue, 7 Jul 2026 01:20:49 +0900
Newsgroups gmane.comp.shells.zsh.devel
Message-ID <[email protected]>
> 2026/07/04 8:46、Mikael Magnusson <[email protected]>のメール:
> 
> This commit makes the test randomly fail for me.

Sorry, I didn't notice this; it doesn't fail on macOS, but
fails on Linux (9/100, in my case).

If I replace
    () { echo > $1 }
by
    () { sleep 1; echo > $1 }
then it fails always, and if I replace
    contextfn() { print -r - $zsh_eval_context[icontext,-1] }
by
    contextfn() { sleep 1; print -r - $zsh_eval_context[icontext,-1] }
then it doesn't fail (at least 100 times).

This indicates that contextfn() closes the namedpipe before the
anonymous function tries to write it.

If fractional seconds is allowed, sleep 0.1 seems to be enough.