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

Zsh 3.1.{6,9} patches



	Hello!

	This is some upgrades i've made for zsh-3.1.6, but it also
useable for zsh-3.1.9

	The first one is code to meke zsh truncate PS1 string backwards.
Just use zro-started argument with %~ command to drop out the REST of
path instead ofte HEAD. See the example (note %01~ entry):
	user@host:/usr..zsh/3.1.9/zsh> pwd; echo $PS1 
	/usr/local/lib/zsh/3.1.9/zsh
	%U%n%u@%B%m%b:%5(~:%01~..%3~:%~)> 
This is useful for keeping starting part of path, so I'll always be
prompted the root of pwd. Who knows how many */bin's a system may have :)
It also possible to use backward flag with another numeric-argumented
commands in the future.

	The second one is Solaris 2.7+ configure patch to make it compile zsh
with libcurses.so by default instead of termcap, which is unnative. If
this is incorrect, and Solaris curses are bugged, please inform me...
I never got a problem using zsh compiled with libcurses.so from Solaris
2.7 (so it was even possible to copy the library to Solaris 2.6 and 2.5.1!).
This is useful for delicate terminal configuring.

	The patchfiles are all for zsh-3.1.9 sources.

			George V Kouryachy (aka Fr. Br. George)
			email: frbrgeorge@xxxxxxxxxxxxxxxxx
--- zsh-3.1.9/Src/prompt.c	Fri Mar 24 13:43:21 2000
+++ zsh-3.1.9.new/Src/prompt.c	Fri Jul  7 17:36:54 2000
@@ -93,6 +93,10 @@
 
 static int dontcount;
 
+/* Backward truncating flag */
+
+static int bw;
+
 /* Strings to use for %r and %R (for the spelling prompt). */
 
 static char *rstring, *Rstring;
@@ -112,7 +116,8 @@
 	modp = tricat("~", nd->nam, p + strlen(nd->dir));
 
     if (npath) {
-	char *sptr;
+      char *sptr;
+      if (!bw) {
 	for (sptr = modp + strlen(modp); sptr > modp; sptr--) {
 	    if (*sptr == '/' && !--npath) {
 		sptr++;
@@ -122,6 +127,15 @@
 	if (*sptr == '/' && sptr[1] && sptr != modp)
 	    sptr++;
 	stradd(sptr);
+      } else {
+        char cbu;
+        for (sptr = modp+1; *sptr; sptr++ )
+	    if (*sptr == '/' && !--npath) break;
+	cbu=*sptr;
+	*sptr=0;
+	stradd(modp);
+	*sptr=cbu;
+      }
     } else
 	stradd(modp);
 
@@ -197,14 +211,16 @@
     Nameddir nd;
 
     for (; *fm && *fm != endchar; fm++) {
-	arg = 0;
+	arg = bw = 0;
 	if (*fm == '%' && isset(PROMPTPERCENT)) {
+	    if (fm[1]=='0') bw=1;
 	    if (idigit(*++fm)) {
 		arg = zstrtol(fm, &fm, 10);
 	    }
 	    if (*fm == '(') {
 		int tc, otrunclen;
 
+		if (fm[1]=='0') bw=1;
 		if (idigit(*++fm)) {
 		    arg = zstrtol(fm, &fm, 10);
 		}
--- zsh-3.1.9/configure	Tue May 30 13:15:39 2000
+++ zsh-3.1.9.new/configure	Fri Jul  7 17:37:54 2000
@@ -2967,7 +2967,7 @@
 
 
 case "$host_os" in
-  aix*|hpux10.*|hpux11.*) termcap_curses_order="curses ncurses termcap" ;;
+  solaris*|aix*|hpux10.*|hpux11.*) termcap_curses_order="curses ncurses termcap" ;;
   *)             termcap_curses_order="termcap curses ncurses" ;;
 esac
 
@@ -5969,12 +5969,12 @@
   fi
   case "$host_os" in
     hpux*)        DLLDFLAGS="${DLLDFLAGS=-b}" ;;
-    freebsd*|linux*|irix*|osf*) DLLDFLAGS="${DLLDFLAGS=-shared}" ;;
+    solaris*|freebsd*|linux*|irix*|osf*) DLLDFLAGS="${DLLDFLAGS=-shared}" ;;
     sunos*)       DLLDFLAGS="${DLLDFLAGS=-assert nodefinitions}" ;;
     sysv4*|esix*) DLLDFLAGS="${DLLDFLAGS=-G $ldflags}" ;;
     netbsd*)      DLLDFLAGS="${DLLDFLAGS=${DLLDARG}-x -shared --whole-archive}" ;;
     aix*)         DLLDFLAGS="${DLLDFLAGS=-G -bexpall -lc}" ;;
-    solaris*|sysv4*|esix*) DLLDFLAGS="${DLLDFLAGS=-G}" ;;
+    sysv4*|esix*) DLLDFLAGS="${DLLDFLAGS=-G}" ;;
     openbsd*)     DLLDFLAGS="${DLLDFLAGS=-Bshareable}" ;;
   esac
   case "$host" in


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