ti/te capabilities patch

Cristiano De Michele <[email protected]> 18 Apr 2002 01:11:25 +0200
Newsgroups gmane.comp.gnome.lib.devel
Message-ID <1019085085.991.3.camel@cripat>
Hi all,
here is a slightly changed patch for clearing the screen
switching to alternate screen as Owen suggested
					regards 
-- 
  Cristiano De Michele,
  Department of Physics,
  University "Federico II" of Naples
vt.c.diff (text/plain, 974 B)
--- /home/demichel/sources/gnome-libs-1.4.1.5/zvt/vt.c	Mon Mar 18 20:39:22 2002
+++ vt.c	Thu Apr 18 00:57:03 2002
@@ -42,7 +42,7 @@
 #include "subshell.h"
 
 /* define to 'x' to enable copious debug of this module */
-#define d(x)
+#define d(x) 
 
 /* this one will check nodes aren't 'past' the end of list */
 #define n(x)
@@ -1117,6 +1117,7 @@
       }
       break;
     case 6:
+      d(printf("state 6 arg: %d\n", vt->arg.num.intargs[i]));
       switch(vt->arg.num.intargs[i]) {
       case 1:			/* turn on application cursor keys */
 	if (on)
@@ -1163,6 +1164,19 @@
 	vt->mode &= ~VTMODE_SEND_MOUSE_MASK;
 	if (on)
 	  vt->mode |= VTMODE_SEND_MOUSE_BOTH;
+	break;
+      case 1049:
+	/* here the application should save the screen and restore it as xterm does!*/
+	vt_set_screen(vt, on?1:0);
+	if (on)
+	  {
+	    vt_save_cursor(vt);
+	    vt_clear_lines(vt, 1, vt->height);
+	  }
+	else
+	  {
+	    vt_restore_cursor(vt);
+	  }
 	break;
       case 1048:
 	if (on)