From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19029 invoked from network); 13 Jul 2004 05:08:57 -0000 Received: from odin.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.85) by ns1.primenet.com.au with SMTP; 13 Jul 2004 05:08:57 -0000 Received: (qmail 1480 invoked from network); 13 Jul 2004 05:12:35 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 13 Jul 2004 05:12:35 -0000 Received: (qmail 6565 invoked by alias); 13 Jul 2004 05:08:42 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 20156 Received: (qmail 6555 invoked from network); 13 Jul 2004 05:08:42 -0000 Received: from odin.dotsrc.org (HELO a.mx.sunsite.dk) (qmailr@130.225.247.85) by sunsite.dk with SMTP; 13 Jul 2004 05:08:42 -0000 Received: (qmail 1224 invoked from network); 13 Jul 2004 05:12:27 -0000 Received: from unknown (HELO moonbase.zanshin.com) (@167.160.213.139) by a.mx.sunsite.dk with SMTP; 13 Jul 2004 05:12:14 -0000 Received: from toltec.zanshin.com (toltec.zanshin.com [64.84.47.166]) by moonbase.zanshin.com (8.12.11/8.12.11) with ESMTP id i6D58RjK013561 for ; Mon, 12 Jul 2004 22:08:27 -0700 Date: Mon, 12 Jul 2004 22:08:27 -0700 (PDT) From: Bart Schaefer Reply-To: zsh-workers@sunsite.dk To: zsh-workers@sunsite.dk Subject: Re: Bug with the new prompt redraw code In-Reply-To: <200407121753.i6CHrQtD008332@news01.csr.com> Message-ID: References: <200407121753.i6CHrQtD008332@news01.csr.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, hits=0.0 required=6.0 tests=none autolearn=no version=2.63 X-Spam-Hits: 0.0 On Mon, 12 Jul 2004, Peter Stephenson wrote: > Bart Schaefer wrote: > > So, what about (1)? To repeat, the intent was to display a multi-line > > prompt immediately after a command finishes, but then refresh only the > > last line of that prompt on subsequent zle redisplays (the original > > example involved SIGWINCH handling). > > It sounds like zrefresh() should be moved earlier, out of zlecore(). > > This means zle-line-init is basically the last thing executed before the > editor starts looking for input. Hence zle-line-init will only affect > the next prompt, but the previous prompt will have been drawn. This does sound like the approach that I asked for, and the C code seems to do the intended things, but it doesn't quite achieve the visible effect that I wanted. The PS1 prompt as set at precmd time does indeed display, regardless of any change made in zle-line-init. However, upon receiving SIGWINCH, the old prompt is still redrawn. The new prompt doesn't kick in until "zle reset-prompt" is run ... but if one runs reset-prompt from zle-line-init, it immediately erases the old prompt and redraws, so we're almost back where we started. The specific case of redrawing only the last line of a multi-line prompt *does* work, but only when the one-line PS1 assigned in zle-line-init is indistinguishable from the last line of the multi-line PS1 assigned in precmd, if you see what I mean. I tried using a TRAPWINCH but that doesn't get executed until _after_ zle has had it's shot at the signal, so one always gets at least one spurious redraw of the old PS1 before anything can be done about it. At this point it's probably not worth messing with further, though there does not seem to be any harm in committing 20153.