zsh-workers
 help / color / mirror / code / Atom feed
* Re: zle_refresh patch 2
@ 1997-03-05 23:52 Zoltan T. Hidvegi
  0 siblings, 0 replies; 16+ messages in thread
From: Zoltan T. Hidvegi @ 1997-03-05 23:52 UTC (permalink / raw)
  To: Zsh workers list; +Cc: schaefer

I wrote:
> Fine, but there are two problems: shortterm is a zle variable and in 3.1
> utils.c has no access to zle globals.  The other problem is that
> resetneeded local variable has the same name as a global one, which is
> misleading.  Also a comparision should use >= 3 instead on > 3.  I simply
> removed the resetneeded variable, since it was really unnecessary.

That's OK, but I forgot that the mail system converts TABs to spaces here.
I complained, and they promised to fix it within two week.  Till then, I'll
use uuencode.  Here is the uuencoded patch.

Zoltan


begin 644 termok_patch
M9&EF9B`M8R!3<F,O<&%R86US+F,N8F%R="!3<F,O<&%R86US+F,**BHJ(%-R
M8R]P87)A;7,N8RYB87)T"5=E9"!-87(@(#4@,3@Z-#`Z,3D@,3DY-PHM+2T@
M4W)C+W!A<F%M<RYC"5=E9"!-87(@(#4@,3@Z-#(Z-3<@,3DY-PHJ*BHJ*BHJ
M*BHJ*BHJ*BH**BHJ(#$R-C8L,3(W,R`J*BHJ"B`@=F]I9`H@('IL979A<G-E
M=&9N*%!A<F%M('!M+"!L;VYG('@I"B`@>PHM("`@("!I;G0@<F5S971N965D
M960@/2`P.PHM(`H@("`@("!I9B`H*&QO;F<@*BEP;2T^9&%T82`]/2`F(&-O
M;'5M;G,I('L*("`):68@*'@@/"`S*2!["B`@"2`@("!I9B`H>"`\/2`P*0HM
M+2T@,3(V-BPQ,C<Q("TM+2T**BHJ*BHJ*BHJ*BHJ*BHJ"BHJ*B`Q,C<U+#$R
M.3<@*BHJ*@H@(`D@("`@96QS90H@(`D)>"`](#(["B`@"2`@("!T97)M;VL@
M/2!415)-7T)!1#L*(2`)?2!E;'-E(&EF("AC;VQU;6YS(#P@,RD*(2`)("`@
M(')E<V5T;F5E9&5D(#T@,3L*("`@("`@?2!E;'-E(&EF("@H;&]N9R`J*7!M
M+3YD871A(#T]("8@;&EN97,I('L*("`):68@*'@@/"`S*2!["B`@"2`@("!I
M9B`H>"`\/2`P*0H@(`D)>"`](#(T.PD)+RH@07)B:71R87)Y+"!B=70@<V%M
M92!A<R!I;FET+F,@*B\*("`)("`@('1E<FUO:R`](%1%4DU?3D]54#L*(2`)
M?2!E;'-E(&EF("AL:6YE<R`\(#,I"B$@"2`@("!R97-E=&YE961E9"`](#$[
M"B`@("`@('T*("`*("`@("`@*B@H;&]N9R`J*7!M+3YD871A*2`]('@["BT@
M"BT@("`@(&EF("AR97-E=&YE961E9"D@>PHM(`EI9B`H;&EN97,@/B`S("8F
M(&-O;'5M;G,@/B`S("8F('1E<FUO:R`A/2!415)-7T]+*0HM(`D@("`@:6YI
M=%]T97)M*"D["2\J($%T=&5M<'0@=&\@<F5S970@=&5R;6]K('!R;W!E<FQY
M("HO"BT@("`@('T*("!]"B`@"B`@+RH@1G5N8W1I;VX@=&\@<V5T('9A;'5E
M(&]F(&=E;F5R:6,@<W!E8VEA;"!S8V%L87(@("`@*@HM+2T@,3(W,RPQ,CDP
M("TM+2T*("`)("`@(&5L<V4*("`)"7@@/2`R.PH@(`D@("`@=&5R;6]K(#T@
M5$5235]"040["B$@"7T@96QS92!I9B`H8V]L=6UN<R`\(#,@)B8@;&EN97,@
M/CT@,R`F)B!T97)M;VL@(3T@5$5235]/2RD*(2`)("`@(&EN:71?=&5R;2@I
M.PDO*B!!='1E;7!T('1O(')E<V5T('1E<FUO:R!P<F]P97)L>2`J+PH@("`@
M("!](&5L<V4@:68@*"AL;VYG("HI<&TM/F1A=&$@/3T@)B!L:6YE<RD@>PH@
M(`EI9B`H>"`\(#,I('L*("`)("`@(&EF("AX(#P](#`I"B`@"0EX(#T@,C0[
M"0DO*B!!<F)I=')A<GDL(&)U="!S86UE(&%S(&EN:70N8R`J+PH@(`D@("`@
M=&5R;6]K(#T@5$5235].3U50.PHA(`E](&5L<V4@:68@*&QI;F5S(#P@,R`F
M)B!C;VQU;6YS(#X](#,@)B8@=&5R;6]K("$](%1%4DU?3TLI"B$@"2`@("!I
M;FET7W1E<FTH*3L)+RH@071T96UP="!T;R!R97-E="!T97)M;VL@<')O<&5R
M;'D@*B\*("`@("`@?0H@(`H@("`@("`J*"AL;VYG("HI<&TM/F1A=&$I(#T@
M>#L*("!]"B`@"B`@+RH@1G5N8W1I;VX@=&\@<V5T('9A;'5E(&]F(&=E;F5R
M:6,@<W!E8VEA;"!S8V%L87(@("`@*@ID:69F("UC(%-R8R]U=&EL<RYC+F)A
M<G0@4W)C+W5T:6QS+F,**BHJ(%-R8R]U=&EL<RYC+F)A<G0)5V5D($UA<B`@
M-2`Q.#HS.3HU-R`Q.3DW"BTM+2!3<F,O=71I;',N8PE7960@36%R("`U(#$X
M.C0P.C(R(#$Y.3<**BHJ*BHJ*BHJ*BHJ*BHJ"BHJ*B`X,3,L.#(P("HJ*BH*
M("`)?0H@("`@("!]"B`@(V5N9&EF("`@+RH@(%1)3T-'5TE.4UH@*B\*+2`@
M("`@1%!55%,H*"$H:7-S970H4TE.1TQ%3$E.15I,12D@?'P@=&5R;6]K("$]
M(%1%4DU?3TL@?'P@;&EN97,@/"`S*0HM(`D@("`A/2`A<VAO<G1T97)M*2P@
M(D)51SH@<VAO<G1T97)M('=R;VYG(&EN(&%D:G5S='=I;G-I>F4B*3L*("!]
M"B`@"B`@+RH@36]V92!A(&9D('1O(&$@<&QA8V4@/CT@,3`@86YD(&UA<FL@
M=&AE(&YE=R!F9"!I;B!F9'1A8FQE+B`@268@=&AE(&9D("H*+2TM(#@Q,RPX
(,3@@+2TM+0IF
`
end


^ permalink raw reply	[flat|nested] 16+ messages in thread
* zle_refresh patch 2
@ 1997-02-03 10:55 gwing
  1997-02-03 18:05 ` Bart Schaefer
  0 siblings, 1 reply; 16+ messages in thread
From: gwing @ 1997-02-03 10:55 UTC (permalink / raw)
  To: zsh-workers

Heyla, 
this goes on top of zsh-workers/2817

It fixes coredumps and bad displays when terms are 1 or 2 lines.
When a terminal is 1 or 2 lines high, the terminal will act as if 
SINGLE_LINE_ZLE is set.  This avoids many problems with the status line.
I also noticed a very minor display problem with singlerefresh(), but it
must have already been present previously - there's an off-by-one calculation
which makes the display slightly wrong.  If I get some more time later 
(unlikely before the weekend) I'll fix it.

BTW, I put some code in utils.c - that's mainly laziness / lack of time
on my part - it's there as a safety net because I didn't check every possible
startup situation.  Ah well...


*** utils.c.org	Mon Feb  3 21:37:39 1997
--- utils.c	Mon Feb  3 21:38:15 1997
***************
*** 864,869 ****
--- 864,873 ----
      if (oldrows != lines)
  	setintenv("LINES", lines);
  #endif   /*  TIOCGWINSZ */
+     if (isset(SINGLELINEZLE) || termok != TERM_OK || lines < 3) /* safety */
+ 	shortterm = 1;
+     else
+ 	shortterm = 0;
  }
  
  /* Move a fd to a place >= 10 and mark the new fd in fdtable.  If the fd *

*** zle.h.~2~	Fri Jan 24 22:50:08 1997
--- zle.h	Mon Feb  3 21:31:47 1997
***************
*** 106,111 ****
--- 106,114 ----
  /* height of left prompt */
  ZLEXTERN int lppth;
  
+ /* terminal is too short to do anything */
+ ZLEXTERN int shortterm;
+ 
  /* last named command done */
  ZLEXTERN int lastnamed;
  
*** zle_misc.c.~2~	Fri Jan 24 22:50:08 1997
--- zle_misc.c	Mon Feb  3 21:33:29 1997
***************
*** 763,769 ****
  void
  tsetcap(int cap, int flag)
  {
!     if (termok && unset(SINGLELINEZLE) && tcstr[cap]) {
  	switch(flag) {
  	case -1:
  	    tputs(tcstr[cap], 1, putraw);
--- 763,769 ----
  void
  tsetcap(int cap, int flag)
  {
!     if (!shortterm) {
  	switch(flag) {
  	case -1:
  	    tputs(tcstr[cap], 1, putraw);

*** zle_refresh.c.~2~	Fri Jan 24 22:50:08 1997
--- zle_refresh.c	Mon Feb  3 21:32:59 1997
***************
*** 72,78 ****
   
      genprompts();
      winw = columns;  /* terminal width */
!     if (isset(SINGLELINEZLE) || termok != TERM_OK)
  	winh = 1;
      else
  	winh = (lines < 2) ? 24 : lines;
--- 72,78 ----
   
      genprompts();
      winw = columns;  /* terminal width */
!     if (shortterm)
  	winh = 1;
      else
  	winh = (lines < 2) ? 24 : lines;
***************
*** 245,250 ****
--- 245,254 ----
  
      cleareol = 0;		/* unset */
      more_start = more_end = 0;	/* unset */
+     if (isset(SINGLELINEZLE) || termok != TERM_OK || lines < 3)
+ 	shortterm = 1;
+     else
+ 	shortterm = 0;
      if (resetneeded) {
  	onumscrolls = 0;
  	setterm();
***************
*** 271,277 ****
                  cleareol = 1;   /* request: clear to end of line */
          if (t0 > -1)
              olnct = t0;
!         if (isset(SINGLELINEZLE) || termok != TERM_OK)
              vcs = 0;
          else if (!clearflag && lpptlen)
              zwrite(lpptbuf, lpptlen, 1, shout);
--- 275,281 ----
                  cleareol = 1;   /* request: clear to end of line */
          if (t0 > -1)
              olnct = t0;
!         if (shortterm)
              vcs = 0;
          else if (!clearflag && lpptlen)
              zwrite(lpptbuf, lpptlen, 1, shout);
***************
*** 288,294 ****
  /* now winw equals columns and winh equals lines 
     width comparisons can be made with winw, height comparisons with winh */
  
!     if (isset(SINGLELINEZLE) || termok != TERM_OK) {
  	singlerefresh();
  	return;
      }
--- 292,298 ----
  /* now winw equals columns and winh equals lines 
     width comparisons can be made with winw, height comparisons with winh */
  
!     if (shortterm) {
  	singlerefresh();
  	return;
      }
***************
*** 355,360 ****
--- 359,371 ----
  
      if (statusline) {
  	tosln = ln + 1;
+         if (ln == winh - 1) {
+ 	    if (nvln > 0) {
+ 		scrollwindow(0);
+ 		nvln--;
+ 	    }
+ 	    tosln--;
+ 	}
  	snextline
  	t = (unsigned char *)statusline;
  	for (; t < (unsigned char *)statusline + statusll; t++) {



-- 
Geoff Wing [gwing@primenet.com.au]   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


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~1997-03-06 19:58 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-03-05 23:52 zle_refresh patch 2 Zoltan T. Hidvegi
  -- strict thread matches above, loose matches on Subject: below --
1997-02-03 10:55 gwing
1997-02-03 18:05 ` Bart Schaefer
1997-02-03 18:34   ` gwing
1997-02-03 19:03     ` Bart Schaefer
1997-02-04  8:25     ` Peter Stephenson
1997-03-05 20:56   ` Zoltan T. Hidvegi
1997-03-05 21:55     ` Bart Schaefer
1997-03-05 23:06       ` Bart Schaefer
1997-03-05 23:47         ` Zoltan T. Hidvegi
1997-03-06  0:51           ` Bart Schaefer
1997-03-06  3:56             ` gwing
1997-03-06  4:58               ` Bart Schaefer
1997-03-06  5:03                 ` gwing
1997-03-06 18:32                   ` Zoltan T. Hidvegi
1997-03-06 18:58             ` Zoltan T. Hidvegi

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).