X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fterminal.c;h=72a7764d3b80163a706ce7d9b65c5c855ce1fa13;hb=8c545e672c902b0a6f1b0b525a6d568b2426b4ad;hp=0a75f71cb0ddb8ad01641f074e23be41101d6f93;hpb=db6be819024985738c7e846ce11f40f4fc8d1aa6;p=sympathy.git diff --git a/src/terminal.c b/src/terminal.c index 0a75f71..72a7764 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -6,10 +6,26 @@ * */ -static char rcsid[] = "$Id$"; +static char rcsid[] = + "$Id$"; /* * $Log$ + * Revision 1.11 2008/02/26 23:56:12 james + * *** empty log message *** + * + * Revision 1.10 2008/02/26 23:23:17 james + * *** empty log message *** + * + * Revision 1.9 2008/02/15 03:32:07 james + * *** empty log message *** + * + * 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 *** * @@ -88,11 +104,15 @@ terminal_close (TTY * _t) set_nonblocking (t->wfd); - 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, "\033%@", 3); //Leave UTF-8 + t->xmit (_t, "\033(B", 3); //US-ASCII in G0 + t->xmit (_t, "\033)B", 3); //US-ASCII in G1 + t->xmit (_t, "\017", 1); //Select G0 + t->xmit (_t, "\033[r", 3); //No margins + t->xmit (_t, "\033[0m", 4); //Default attributes + i = sprintf (buf, "\033[%d;%dH", CRT_ROWS + 1, 1); //Cursor to bottom t->xmit (_t, buf, i); - t->xmit (_t, "\033[J", 3); + t->xmit (_t, "\033[J", 3); //erase rest of screen set_blocking (t->rfd); set_blocking (t->wfd); @@ -235,16 +255,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; @@ -267,6 +288,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);