spacezsh-prompt icon indicating copy to clipboard operation
spacezsh-prompt copied to clipboard

stderr is redirected to /dev/null ocassionally

Open laggardkernel opened this issue 6 years ago • 2 comments
trafficstars

No stderr output is displayed in the shell sometimes. It is probably an upstream bug in mafredri/zsh-async. Stderr is redirected by exec 2>/dev/null in function _async_worker within async.zsh.

https://github.com/mafredri/zsh-async/blob/95c2b1577f455728ec01cec001a86c216d0af2bd/async.zsh#L67-L71

laggardkernel avatar Nov 07 '19 07:11 laggardkernel

Seems a known and fixed bug in zsh-async#35. But in my former experience, remove exec 2>/dev/null may not be enough, the stderr is still lost sometime after computer wakeup. Let's update zsh-async and wait for later test.

laggardkernel avatar Nov 25 '20 02:11 laggardkernel

Still no idea why remove exec 2>/dev/null within zsh-async is not enough. After such a long time, I found a way to trigger this bug 100% at last.

Run go test on https://github.com/quii/learn-go-with-tests/tree/master/select/v3, and switch to another dir. fd 2 will be redirected to /dev/stderr every time I try this.

I'll just redirect fd 2 back after calling async_stop_worker.

laggardkernel avatar May 02 '21 10:05 laggardkernel