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

precmd: write error: interrupted



Hi everyone. I while ago I posted this:

  http://www.zsh.org/mla/users/2012/msg00757.html

about precmd emitting a write error on startup.
I still have the error, as I didn't find any way to silence it (braces around print do not work?!).

I tried hard yesterday to debug this issue, by repeatedly stracing zsh until I got the error.

What's happening is that the terminal is being resized immediately after starting, and a SIGWINCH is emitted while the actual "precmd" write is being done on stdout. The call is not restarted and the write fails.

I have no idea which write is actually failing in that function (I suppose it's some "fputs" in bin_print). Unfortunately if I try to run zsh through a debugger the startup is too slow and never triggers the issue. Also, this seems to only happen in tiling window managers, and the explanation is now obvious: the terminal is forced onto a specific geometry quickly after the window is mapped. Point in fact, "spectrwm" gives me this problem twice as much as "awesomewm" because it's snappier :(. I really wished I had dtrace here...

I suppose SIGWINCH should me masked when writing to the terminal.
Can somebody help with this?

1) SIGWINCH should either be masked or allow write to restart.
2) Why "precmd() { { print "HELLO" } >&- 2>&-; } doesn't suppress the error in this case?

Thanks.



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