chiark / gitweb /
*** empty log message ***
[sympathy.git] / src / terminal.c
index 7bbc761080aa390b9c0944efaac8f0f9d446619f..ab048fdd75d5d87f4b8936fb97375e1d6c513f6d 100644 (file)
@@ -10,6 +10,18 @@ static char rcsid[] = "$Id$";
 
 /*
  * $Log$
+ * Revision 1.8  2008/02/14 10:39:14  james
+ * *** empty log message ***
+ *
+ * Revision 1.7  2008/02/14 01:55:57  james
+ * *** empty log message ***
+ *
+ * Revision 1.6  2008/02/14 00:57:58  james
+ * *** empty log message ***
+ *
+ * Revision 1.5  2008/02/13 18:05:06  james
+ * *** empty log message ***
+ *
  * Revision 1.4  2008/02/13 16:57:29  james
  * *** empty log message ***
  *
@@ -82,10 +94,11 @@ terminal_close (TTY * _t)
   set_nonblocking (t->wfd);
 
 
-  t->xmit (t, "\033[r", 3);
-  t->xmit (t, "\033[0m", 4);
+  t->xmit (_t, "\033[r", 3);
+  t->xmit (_t, "\033[0m", 4);
   i = sprintf (buf, "\033[%d;%dH", CRT_ROWS + 1, 1);
-  t->xmit (t, buf, i);
+  t->xmit (_t, buf, i);
+  t->xmit (_t, "\033[J", 3);
 
   set_blocking (t->rfd);
   set_blocking (t->wfd);
@@ -149,7 +162,7 @@ terminal_dispatch (void)
   terminal_winches = 0;
 
   for (t = terminal_list; t; t = t->next)
-    terminal_getsize (t);
+    terminal_getsize ((TTY *) t);
 
 }
 
@@ -228,16 +241,17 @@ terminal_register_handlers (void)
   sigaction (SIGINT, &sa, NULL);
 }
 
+
 TTY *
 terminal_open (int rfd, int wfd)
 {
   TERMINAL *t;
   pid_t child;
-  char name[1024];
   struct termios termios;
 
   t = (TERMINAL *) malloc (sizeof (TERMINAL));
 
+  strcpy(t->name,"terminal");
   t->rfd = rfd;
   t->wfd = wfd;
 
@@ -260,6 +274,7 @@ terminal_open (int rfd, int wfd)
   t->recv = terminal_read;
   t->xmit = terminal_write;
   t->close = terminal_close;
+  t->blocked = 0;
 
 
   terminal_getsize ((TTY *) t);