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

Re: yet another undesired 3.1.5-pws-15 change



Timothy J Luoma wrote:
> There's still a problem with my PROMPT:
> 
> PROMPT='
> ---------------------------------------- %t/%T  
> ----------------------------------------
> %S[OLDPWD: $OLDPWD]
>    [PWD: %~]%s
> %B%n$LOCAL_HOST%b $REMOTE_HOST
> '
> 
> it produces an extra blank line at the end (unlike 3.1.4)

I didn't dare fix this when I originally spotted it, but I think the answer
is the following.  It doesn't have any immediately obvious ill effects.

--- Src/Zle/zle_refresh.c.pw	Mon Apr 19 09:59:35 1999
+++ Src/Zle/zle_refresh.c	Sun Apr 25 15:30:02 1999
@@ -327,7 +327,7 @@
             vcs = 0;
         else if (!clearflag && lpromptbuf[0]) {
             zputs(lpromptbuf, shout);
-	    if (lpromptw == 0)
+	    if (lpromptw == 0 && lprompth == 1)
 		zputs("\n", shout);	/* works with both hasam and !hasam */
 	}
 	if (clearflag) {
@@ -947,7 +947,7 @@
 		zputc('\r', shout);
 	    tc_upcurs(lprompth - 1);
 	    zputs(lpromptbuf, shout);
-	    if (lpromptw == 0)
+	    if (lpromptw == 0 && lprompth == 1)
 		zputs("\n", shout);	/* works with both hasam and !hasam */
 	}
 	i = lpromptw;

-- 
Peter Stephenson <pws@xxxxxxxxxxxxxxxxx>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy



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