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

zle patch 1



Heyla,
  this is a patch on 3.0.3-test3 for "redisplay" bug Zoltan mentioned.
  I'm not a user of multiline prompts so I haven't done extensive testing of
  this.  Anyone who knows about prompt generation may want to check my
  counting of lines in a prompt.

Problems being (re)checked:
   2726/2760 (Robert F Tobler) - problem on Sun - can't duplicate yet.
   NeXTStep TERMCAP entry

Bugs being fixed:
   Coredump on 2 line terminal when using long status line.


*** zle.h.orig	Mon Aug 12 11:39:05 1996
--- zle.h	Thu Jan 23 15:37:12 1997
***************
*** 103,108 ****
--- 103,111 ----
  /* line length */
  ZLEXTERN int ll;
  
+ /* height of left prompt */
+ ZLEXTERN int lppth;
+ 
  /* last named command done */
  ZLEXTERN int lastnamed;
  
*** zle_misc.c.orig	Thu Jan 23 14:59:08 1997
--- zle_misc.c	Thu Jan 23 15:45:21 1997
***************
*** 803,809 ****
  /* get a prompt string */
  
  static char *buf, *bp1, *bl0, *fm, *pmpt;
! static int bracepos, bufspc;
  
  /**/
  char *
--- 803,809 ----
  /* get a prompt string */
  
  static char *buf, *bp1, *bl0, *fm, *pmpt;
! static int bracepos, bufspc, pmpth;
  
  /**/
  char *
***************
*** 815,820 ****
--- 815,821 ----
  	    *wp = 0;
  	return ztrdup("");
      }
+     pmpth = 1;
  
      if (!termok && (unset(INTERACTIVE)))
          init_term();
***************
*** 841,846 ****
--- 842,848 ----
  		*wp = 0;
  		*bp++ = ' ';
  		++*lenp;
+ 		pmpth++;
  	    }
  	    if (!*wp && *lenp) {
  		addbufspc(1);
***************
*** 850,855 ****
--- 852,859 ----
  	    }
  	}
      }
+     if (pmpt == lpmpt)
+ 	lppth = pmpth;
  
      return buf;
  }
***************
*** 1294,1302 ****
--- 1298,1309 ----
  	    *bp++ = c;
  	    bl0 = bp;
  	    lensb = 0;
+ 	    pmpth++;
  	    return;
  	}
      }
+     if (bp - bl0 == columns)
+ 	pmpth++;
      *bp++ = c;
  }
  
*** zle_refresh.c.orig	Thu Jan 23 14:58:34 1997
--- zle_refresh.c	Thu Jan 23 15:55:48 1997
***************
*** 258,263 ****
--- 258,269 ----
  	resetvideo();
  	resetneeded = 0;	/* unset */
  	oput_rpmpt = 0;		/* no right-prompt currently on screen */
+ 
+ 	/* we probably should only have explicitly set attributes */
+ 	tsetcap(TCALLATTRSOFF, 0);
+ 	tsetcap(TCSTANDOUTEND, 0);
+ 	tsetcap(TCUNDERLINEEND, 0);
+ 
          if (!clearflag)
              if (tccan(TCCLEAREOD))
                  tcout(TCCLEAREOD);
***************
*** 904,911 ****
  void
  redisplay(void)
  {
!     moveto(0, pptw);
!     zputc('\r', shout);
      resetneeded = 1;
      clearflag = 0;
  }
--- 910,918 ----
  void
  redisplay(void)
  {
!     moveto(0, 0);
!     zputc('\r', shout);		/* extra care */
!     tc_upcurs(lppth - 1);
      resetneeded = 1;
      clearflag = 0;
  }


-- 
Geoff Wing [gwing@xxxxxxxxxxxxxxx]   Technical Manager
  Phone    : +61-3-9818 2977	     PrimeNet - Internet Consultancy
  Facsimile: +61-3-9819 3788	     Web : <URL:http://www.primenet.com.au/>
  Mobile   : 0412 162 441



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