Re: patch for window-title shell heuristic

[email protected] Mon, 2 Jan 2006 10:40:39 -0500
Newsgroups gmane.comp.gnu.screen
Message-ID <[email protected]>
On Mon, Jan 02, 2006 at 03:32:25PM +0000, bill wrote:
> Hey Erik,
> 
> 
> I would love to see the patch, but you forgot to attach it!  (or for some
> reason, it didn't get through to me)  I'm having a hard time finding
> the right place in the code to do the caption renderings, and seeing your 
> patch
> would help a lot.
> 
> I like the idea, BTW.  I've been doing the same type of thing by having
> my vi command be a function which sets the title (or having vim set
> the titlestring...I toggle between the two and can't remember which
> technique I finally settled on), but your method is cleaner.

I think I did attach it...maybe the mailing list filtered it since I'm
not a member.

Regardless, I'm sending it again. It is definitely attached this time.

-- Erik
full_aka.patch (text/plain, 999 B)
diff -urN screen-4.0.2/ansi.c screen-erik/ansi.c
--- screen-4.0.2/ansi.c	2003-12-05 08:57:05.000000000 -0500
+++ screen-erik/ansi.c	2005-12-28 13:39:38.000000000 -0500
@@ -2237,6 +2237,18 @@
       else
 	wp->w_autoaka = 0;
       line = cp;
+#ifdef FULL_AKA
+      //erik's modification
+      y = (int)cp;
+      while (len)
+	{
+	  if (*cp++ != ' ')
+	    y = (int)cp;
+	  len--;
+	}
+      ChangeAKA(wp, (char *)line, (int)y - (int)line);
+#else
+      // original code
       while (len && *cp != ' ')
 	{
 	  if (*cp++ == '/')
@@ -2244,6 +2256,7 @@
 	  len--;
 	}
       ChangeAKA(wp, (char *)line, cp - line);
+#endif
     }
   else
     wp->w_autoaka = 0;
diff -urN screen-4.0.2/ansi.h screen-erik/ansi.h
--- screen-4.0.2/ansi.h	2003-02-24 11:55:08.000000000 -0500
+++ screen-erik/ansi.h	2005-12-28 13:39:38.000000000 -0500
@@ -168,3 +168,6 @@
 # define dw_left(ml, x, enc) 0
 # define dw_right(ml, x, enc) 0
 #endif
+
+/* added by erik... to use full cmd for autoaka */
+#define FULL_AKA 1