4 * Copyright (c) 2008 James McKenzie <james@fishsoup.dhs.org>,
14 * Revision 1.6 2008/02/06 20:26:58 james
15 * *** empty log message ***
17 * Revision 1.5 2008/02/06 17:53:28 james
18 * *** empty log message ***
20 * Revision 1.4 2008/02/04 20:23:55 james
21 * *** empty log message ***
23 * Revision 1.3 2008/02/04 05:45:55 james
26 * Revision 1.2 2008/02/04 02:05:06 james
27 * *** empty log message ***
29 * Revision 1.1 2008/02/03 16:20:24 james
30 * *** empty log message ***
37 struct termios old = { 0 };
38 static int had_winch = 0;
43 tcsetattr (0, TCSANOW, &old);
57 struct termios raw = { 0 };
66 signal (SIGINT, quit);
68 struct sigaction sa = { 0 };
70 sa.sa_handler = winch;
71 sa.sa_flags = SA_RESTART;
72 sigaction (SIGWINCH, &sa, NULL);
79 tcsetattr (0, TCSANOW, &raw);
91 struct timeval tv = { 0, 100000 };
95 if (select (t->fd + 1, &rfd, NULL, NULL, &tv) < 0)
98 if (FD_ISSET (a.fd, &rfd))
100 if (ansi_dispatch(&a,v)) break;
103 if (FD_ISSET (t->fd, &rfd)) {
104 if (vt102_dispatch (v)) break;
112 ansi_draw (&a, &v.crt);
115 tcsetattr (0, TCSANOW, &old);