zsh-users
 help / color / mirror / code / Atom feed
* precmd: write error: interrupted
@ 2013-04-25 16:47 Yuri D'Elia
  2013-04-25 17:44 ` Yuri D'Elia
  2013-04-25 18:16 ` Bart Schaefer
  0 siblings, 2 replies; 13+ messages in thread
From: Yuri D'Elia @ 2013-04-25 16:47 UTC (permalink / raw)
  To: zsh-users

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.


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2013-04-26 18:22 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-25 16:47 precmd: write error: interrupted Yuri D'Elia
2013-04-25 17:44 ` Yuri D'Elia
2013-04-25 18:27   ` Bart Schaefer
2013-04-25 18:16 ` Bart Schaefer
2013-04-25 18:38   ` Peter Stephenson
2013-04-25 22:18     ` Bart Schaefer
2013-04-26  0:52       ` Bart Schaefer
2013-04-25 19:38   ` Yuri D'Elia
2013-04-26  0:53     ` Bart Schaefer
2013-04-25 20:05   ` Yuri D'Elia
2013-04-25 20:58     ` Yuri D'Elia
2013-04-26 15:08     ` Bart Schaefer
     [not found]     ` <130426080805.ZM18619__18102.73175729$1366989065$gmane$org@torch.brasslantern.com>
2013-04-26 17:59       ` Yuri D'Elia

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).