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

PATCH: fix menu completion on terminal with do=^J/without do



Standard termcap for Linux console defines "do" (down_cursor) as ^J.  Zsh 
init_term ignores it in this case (Geoff, could you enlighten why it does 
it?); it then provides workaround in zle_refresh by actually using ^J but 
moving cursor to needed column then.

Unfortunately complist is using termcap directly and thus outputs no 
down_cursor at all but believes it has moved to correct line.

The patch exports tc_downcurs and makes complist using it. I refrain from 
removing ^J code in init_term not knowing reasons or possible implications.

If it is OK I commit it tomorrow.

-andrey

--- Src/Zle/complist.c.tcdown	2002-10-15 22:00:02.000000000 +0400
+++ Src/Zle/complist.c	2003-04-27 11:22:26.000000000 +0400
@@ -1556,7 +1556,7 @@ singledraw()
     mcc2 = singlecalc(&mc2, ml2, &lc2);
 
     if (md1)
-        tcmultout(TCDOWN, TCMULTDOWN, md1);
+        tc_downcurs(md1);
     if (mc1)
         tcmultout(TCRIGHT, TCMULTRIGHT, mc1);
     g = mgtab[ml1 * columns + mc1];
@@ -1565,7 +1565,7 @@ singledraw()
     putc('\r', shout);
 
     if (md2 != md1)
-        tcmultout(TCDOWN, TCMULTDOWN, md2 - md1);
+        tc_downcurs(md2 - md1);
     if (mc2)
         tcmultout(TCRIGHT, TCMULTRIGHT, mc2);
     g = mgtab[ml2 * columns + mc2];
@@ -1576,7 +1576,7 @@ singledraw()
     if (mstatprinted) {
         int i = lines - md2 - nlnct;
 
-        tcmultout(TCDOWN, TCMULTDOWN, i - 1);
+        tc_downcurs(i - 1);
         compprintfmt(NULL, 0, 1, 1, mline, NULL);
         tcmultout(TCUP, TCMULTUP, lines - 1);
     } else
--- Src/Zle/zle_refresh.c.tcdown	2003-04-04 17:56:44.000000000 +0400
+++ Src/Zle/zle_refresh.c	2003-04-27 11:21:14.000000000 +0400
@@ -1062,7 +1062,7 @@ tc_rightcurs(int ct)
 }
 
 /**/
-static int
+mod_export int
 tc_downcurs(int ct)
 {
     int ret = 0;


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