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

feature-request of double-tab-list



Dear zsh-workers,

First i'd like to tell you that I really like zsh. Best shell there is!
However, there is one small thing I like better about bash, and that's the
double-tab-press or what ever you'd want to call it. It's sort of like zsh
with AUTO_LIST set, but with the exception that you have to press tab
twice before the list is displayed.
Of course the other features of zsh outweighs that one advantage eith
bash, so I still use zsh as my loginshell, as well as favourite
shellscript-interpreter.

I've made an ugly patch that fixes it the way I like it, but it only
hardcodes it into the shell. I'm attaching it to this mail, just to
explain more exactly what it is I'd like.
I suppose the correct way of doing is would be to have a variable that
controls how many times you need to press tab before the list shows, and
the turn the feature on or off with the AUTO_LIST option.
I had plans to fix it this way myself, and send you that patch instead,
but I havn't got around to doing it yet, and I'm not sure I ever will...

Anyway, I hope you'll include something like this in future releases of
zsh.
Cheers!

/Rasmus Tengblad
http://www.lysator.liu.se/~marvin


PS. If this doesn't make any sense to you, don't hesitate to ask.
diff -r -X skiplist -U 3 zsh/Src/zle.h /home/marvin/src/zsh/Src/zle.h
--- zsh/Src/zle.h	Wed Jul 22 13:26:22 1998
+++ /home/marvin/src/zsh/Src/zle.h	Fri Jul 24 12:27:28 1998
@@ -36,6 +36,12 @@
 #endif
 
 #ifdef ZLE
+
+/* Number of tabs in a sequence needed to show completionlist */
+#define TABS_REQUIRED 2
+
+/* Number of tabs pressed in sequence */
+ZLEXTERN int tabcount;
 
 /* size of line buffer */
 ZLEXTERN int linesz;
diff -r -X skiplist -U 3 zsh/Src/zle_main.c /home/marvin/src/zsh/Src/zle_main.c
--- zsh/Src/zle_main.c	Wed Jul 22 13:26:23 1998
+++ /home/marvin/src/zsh/Src/zle_main.c	Fri Jul 24 12:27:28 1998
@@ -360,6 +360,7 @@
     tv.tv_sec = 0;
 #endif
 
+    tabcount = 0;
     keytimeout = getiparam("KEYTIMEOUT");
     if (!shout) {
 	if (SHTTY != -1)
diff -r -X skiplist -U 3 zsh/Src/zle_tricky.c /home/marvin/src/zsh/Src/zle_tricky.c
--- zsh/Src/zle_tricky.c	Wed Jul 22 13:26:23 1998
+++ /home/marvin/src/zsh/Src/zle_tricky.c	Fri Jul 24 12:27:29 1998
@@ -2994,6 +2994,8 @@
 {
     if(showinglist == -2)
 	listmatches();
+    else
+       tabcount = 0;
     if(validlist) {
 	freearray(amatches);
 	zsfree(rpre);
@@ -3177,9 +3179,10 @@
     }
     /* At this point, we might want a completion listing.  Show the listing *
      * if it is needed.                                                     */
-    if (isset(LISTBEEP))
+    if (isset(LISTBEEP) && tabcount==0)
 	feep();
-    if (isset(AUTOLIST) && !amenu && !showinglist)
+    if ( (isset(AUTOLIST) || (tabcount++ == TABS_REQUIRED-1))
+	 && !amenu && !showinglist)
 	showinglist = -2;
     if(inv)
 	invalidatelist();


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