zsh-workers
 help / color / mirror / code / Atom feed
From: Tatsuo Furukawa <frkwtto@osk3.3web.ne.jp>
To: schaefer@brasslantern.com
Cc: zsh-workers@sunsite.auc.dk
Subject: Re: Patch available for 3.0.6-pre-0
Date: Fri, 23 Apr 1999 00:07:13 +0900	[thread overview]
Message-ID: <199904221543.AAA09973@pop1.ngy.3web.ne.jp> (raw)
In-Reply-To: <990421090539.ZM11007@candle.brasslantern.com> (schaefer@brasslantern.com)

Hello, Bart,  Thank you for quick response.

Bart> There are other programs than zsh that would be confused by this
Bart> behavior.

Yes.  (But I didn't know yesterday.)  According "termcap & terminfo"
book, UNIX assumes that tab stop are assigned to 8, 16, 24, 32, ....
So, I don't have to think that TAB stop is valiable.

Bart> Am I wrong in thinking the fix for this is `stty -tabs` ?  

I tried it.  And this works completely well!  So, `stty -tabs` are
good solution.  But it is not a perfect solution for perfomance.


Bart> but as a frequent ssh-over-28.8-PPP-link user, I'm sensitive to
Bart> issues with speed of screen refresh and I'd rather not be
Bart> needlessly penalized.

I think that most of users is NOT affected by this patch.  Because
NORMAL terminal has RI= entry.  If the terminal has RI= entry, zsh
will use it.  If it doesn't, zsh will use another method (TAB will be
used).  So, maybe, I think you will not affect any more.

But, I am begining to think that it is not interesting to apply
degrade patch.  So, I wrote a new patch. :-)


Hpterm does not have RI= entry. (RI is relative horizontal cursor
move).  But hpterm has ch= entry.  (ch is absolute horizontal cursor
move).  I added the code that zsh supports 'ch=' entry.

And I found that zle_refresh.c has two similar function.
(tc_rightcurs() and singmoveto()).  I modified tc_rightcurs().
tc_rightcurs() is originally absolute cursor move.  Now,
tc_rightcurs() is relative cursor move.  Because tc_leftcurs() is
relative, they are a couple now.  (If you want to move absolutely, use
 singmoveto()).


Here is the patch:

diff -ur zsh-3.0.6-pre0/Src/globals.h zsh-3.0.6-pre0-new/Src/globals.h
--- zsh-3.0.6-pre0/Src/globals.h	Wed Apr 21 18:53:47 1999
+++ zsh-3.0.6-pre0-new/Src/globals.h	Thu Apr 22 10:57:01 1999
@@ -614,7 +614,7 @@
 {
     "cl", "le", "LE", "nd", "RI", "up", "UP", "do",
     "DO", "dc", "DC", "ic", "IC", "cd", "ce", "al", "dl", "ta",
-    "md", "so", "us", "me", "se", "ue"
+    "md", "so", "us", "me", "se", "ue", "ch"
 };
 #else
 extern char *tccapnams[TC_COUNT];
diff -ur zsh-3.0.6-pre0/Src/zle_refresh.c zsh-3.0.6-pre0-new/Src/zle_refresh.c
--- zsh-3.0.6-pre0/Src/zle_refresh.c	Fri Sep 26 10:42:19 1997
+++ zsh-3.0.6-pre0-new/Src/zle_refresh.c	Thu Apr 22 20:47:04 1999
@@ -808,20 +808,8 @@
 	}
     }
 
-    if (cl == vcs)
-	return;
-
-/* choose cheapest movements for ttys without multiple movement capabilities -
-   do this now because it's easier (to code) */
-    if (cl <= vcs / 2) {
-	zputc('\r', shout);
-	vcs = 0;
-    }
-    if (vcs < cl)
-	tc_rightcurs(cl);
-    else if (vcs > cl)
-	tc_leftcurs(vcs - cl);
-    vcs = cl;
+    if (cl != vcs)
+       singmoveto(cl);
 }
 
 /**/
@@ -841,14 +829,16 @@
 
 /**/
 void
-tc_rightcurs(int cl)
+tc_rightcurs(int ct)
 {
-    int ct,			/* number of characters to move across	    */
-	i = vcs,		/* cursor position after initial movements  */
+/* ct: number of characters to move across      */
+/*     cursor position after initial movements  */
+    int cl,			
+	i = vcs,		
 	j;
     char *t;
 
-    ct = cl - vcs;
+    cl = ct + vcs;
 
 /* do a multright if we can - it's the most reliable */
     if (tccan(TCMULTRIGHT)) {
@@ -1060,23 +1050,29 @@
 {
     if (pos == vcs)
 	return;
+
+/* do a horizontal position if we can */
+    if (tccan(TCHORIZPOS)) {
+	tcoutarg(TCHORIZPOS, pos);
+	vcs = pos;
+	return;
+    }
+
+
+/* choose cheapest movements for ttys without multiple movement capabilities -
+   do this now because it's easier (to code) */
+
     if (pos <= vcs / 2) {
 	zputc('\r', shout);
 	vcs = 0;
     }
-    if (pos < vcs) {
-	tc_leftcurs(vcs - pos);
+
+    if (pos < vcs)
+       tc_leftcurs(vcs - pos);
+    else if (pos > vcs)
+       tc_rightcurs(pos - vcs);
+
 	vcs = pos;
-    }
-    if (pos > vcs) {
-	if (tcmultout(TCRIGHT, TCMULTRIGHT, pos - vcs))
-	    vcs = pos;
-	else
-	    while (pos > vcs) {
-		zputc(nbuf[0][vcs], shout);
-		vcs++;
-	    }
-    }
 }
 
 /* generate left and right prompts */
diff -ur zsh-3.0.6-pre0/Src/zsh.h zsh-3.0.6-pre0-new/Src/zsh.h
--- zsh-3.0.6-pre0/Src/zsh.h	Wed Apr 21 18:53:49 1999
+++ zsh-3.0.6-pre0-new/Src/zsh.h	Thu Apr 22 11:07:22 1999
@@ -1249,7 +1249,8 @@
 #define TCALLATTRSOFF  21
 #define TCSTANDOUTEND  22
 #define TCUNDERLINEEND 23
-#define TC_COUNT       24
+#define TCHORIZPOS     24
+#define TC_COUNT       25
 
 #define tccan(X) (tclen[X])
 

-- 
Tatsuo Furukawa  (frkwtto@osk3.3web.ne.jp)


  reply	other threads:[~1999-04-23  0:07 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-04-21  8:15 Bart Schaefer
1999-04-21  8:47 ` Peter Stephenson
1999-04-21 14:14 ` Tatsuo Furukawa
1999-04-21 16:05   ` Bart Schaefer
1999-04-22 15:07     ` Tatsuo Furukawa [this message]
1999-04-24  5:53       ` Bart Schaefer
1999-04-25  6:57         ` Geoff Wing
1999-04-26 15:22           ` Tatsuo Furukawa
1999-04-27 16:24             ` Bart Schaefer
1999-04-21 23:52 ` Wayne Davison
1999-04-24  4:32   ` Bart Schaefer
1999-04-24  7:12     ` Wayne Davison
1999-04-23 12:48 Sven Wischnowsky
1999-04-23 14:13 Sven Wischnowsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=199904221543.AAA09973@pop1.ngy.3web.ne.jp \
    --to=frkwtto@osk3.3web.ne.jp \
    --cc=schaefer@brasslantern.com \
    --cc=zsh-workers@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).