From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5457 invoked by alias); 25 Apr 2013 16:48:12 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 17776 Received: (qmail 24995 invoked from network); 25 Apr 2013 16:48:00 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_NUMERIC_HELO,SPF_HELO_PASS autolearn=no version=3.3.2 Received-SPF: pass (ns1.primenet.com.au: SPF record at m.gmane.org designates 80.91.229.3 as permitted sender) X-Injected-Via-Gmane: http://gmane.org/ To: zsh-users@zsh.org From: Yuri D'Elia Subject: precmd: write error: interrupted Date: Thu, 25 Apr 2013 18:47:44 +0200 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 193.106.183.18 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.12) Gecko/20130116 Icedove/10.0.12 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.