From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23917 invoked from network); 6 Aug 2005 17:36:43 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 6 Aug 2005 17:36:43 -0000 Received: (qmail 41013 invoked from network); 6 Aug 2005 17:36:35 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 6 Aug 2005 17:36:35 -0000 Received: (qmail 5951 invoked by alias); 6 Aug 2005 17:36:32 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 21567 Received: (qmail 4559 invoked from network); 6 Aug 2005 17:20:30 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 6 Aug 2005 17:20:30 -0000 Received: (qmail 36581 invoked from network); 6 Aug 2005 17:20:30 -0000 Received: from sccimhc91.asp.att.net (63.240.76.165) by a.mx.sunsite.dk with SMTP; 6 Aug 2005 17:20:26 -0000 Received: from unicorn.bullok.com (12-208-70-16.client.insightbb.com[12.208.70.16]) by sccimhc91.asp.att.net (sccimhc91) with ESMTP id <20050806172025i9100an6ase>; Sat, 6 Aug 2005 17:20:25 +0000 From: Dan Bullok To: zsh-workers@sunsite.dk Subject: PATCH: (one-liner) adjustwinsize doesn't update prompt string Date: Sat, 6 Aug 2005 12:20:23 -0500 User-Agent: KMail/1.8.1 MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_YFP9CVxdLMkRapw" Message-Id: <200508061220.24187.dan@bullok.com> X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.0.4 --Boundary-00=_YFP9CVxdLMkRapw Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline zsh 4.2.5 does not re-evaluate the prompt string when the window size changes. When the window size changes, it seems to me that zle should know about it, and redisplay the prompt appropriately. Most of the two line prompts get very screwed up on a window resize, and you have to hit enter for them to behave again. There's another closely related issue that's bugging me, which I don't have a fix for. When the window is resized, zsh keeps moving the prompt down a line at a time. This isn't a big deal, except that it often ends up causing the display to scroll up so that I can't see anything but the messed up prompt bits on screen. Is it necessary to do this when the display is updated? Is there a way to prevent it without messing everything else up? I've looked at zrefresh for a couple of hours, but I'm completely confused by it. -Dan --Boundary-00=_YFP9CVxdLMkRapw Content-Type: text/x-diff; charset="us-ascii"; name="zsh-4.2.5-zrefresh.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="zsh-4.2.5-zrefresh.diff" diff -ur zsh-4.2.5.ORIG/Src/utils.c zsh-4.2.5/Src/utils.c --- zsh-4.2.5.ORIG/Src/utils.c 2005-03-21 12:49:00.000000000 -0600 +++ zsh-4.2.5/Src/utils.c 2005-08-06 07:43:46.000000000 -0500 @@ -1054,7 +1054,7 @@ winchanged = #endif /* TIOCGWINSZ */ resetneeded = 1; - zrefresh(); + trashzle(); } } Only in zsh-4.2.5/Src: utils.c~ --Boundary-00=_YFP9CVxdLMkRapw Content-Type: application/x-shellscript; name="prompt_stretchy_setup" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="prompt_stretchy_setup" #!/bin/zsh prompt_stretchy_setup () { PS1="\$(prompt_stretchy_line1)${prompt_newline}-->" PS2="---%{$fg_bold[white]%}%_> %{${fg_nobold[white]}%}" PS3="%{$fg_bold[white]%}?# %{${fg_nobold[white]}%}" } prompt_stretchy_line1 () { datestr="[$(date)]" local datestrwid=${#datestr} local prompt_padding_size=$(( COLUMNS - 1 - datestrwid )) local prompt_padding if (( prompt_padding_size > 0 )); then eval "prompt_padding=\${(l:${prompt_padding_size}::-:)_empty_zz}" echo -n "%{${fg_bold[cyan]}%}${prompt_padding}%{${fg_bold[green]}%}$datestr" return fi prompt_padding_size=$(( COLUMNS -1 )) # Didn't fit; just return padding if (( prompt_padding_size > 0 )); then eval "prompt_padding=\${(l:${prompt_padding_size}::-:)_empty_zz}" echo -n "%{${fg_bold[cyan]}%}${prompt_padding}" return fi # a terminal with 1 column? nice... echo -n "" } prompt_stretchy_preexec () { print -n "${reset_color}" } prompt_stretchy_setup "$@" --Boundary-00=_YFP9CVxdLMkRapw--