21 if (x > xmax || y > ymax) {
25 buf[0] = get_next_char();
29 case '\000': /* nulls, just ignore 'em */
32 case '\007': /* bell */
36 case '\t': /* tab modulo 8 */
41 switch(get_next_char()) {
47 case '&': /* position cursor &c */
48 switch(get_next_char()) {
77 case 'd': /* underline stuff */
78 if ((n=get_next_char())>='A' && n <= 'O')
91 case 'i': /* back tab */
96 case 'H': /* home cursor */
102 case 'L': /* insert blank line */
103 scroll(y, ymax, y+1, y);
106 case 'M': /* delete line */
107 scroll(y+1, ymax+1, y, ymax);
110 case 'J': /* clear to end of display */
111 xtipple(Rpt(pt(0, y+1),
112 pt(xmax+1, ymax+1)));
114 case 'K': /* clear to EOL */
115 xtipple(Rpt(pt(x, y),
119 case 'P': /* delete char */
120 bitblt(&screen, pt(x, y),
121 &screen, Rpt(pt(x+1, y),
124 xtipple(Rpt(pt(xmax, y),
128 case 'Q': /* enter insert mode */
132 case 'R': /* leave insert mode */
136 case 'S': /* roll up */
137 scroll(1, ymax+1, 0, ymax);
141 scroll(0, ymax, 1, 0);
144 case 'A': /* upline */
157 case 'C': /* right */
169 case '\b': /* backspace */
174 case '\n': /* linefeed */
177 if( ttystate[cs->raw].nlcr )
181 case '\r': /* carriage return */
184 if( ttystate[cs->raw].crnl )
188 default: /* ordinary char */
191 while (!cs->raw && host_avail() && x+n<=xmax && n<BUFS
192 && (c = get_next_char())>=' ' && c<'\177') {
198 bitblt(&screen, pt(x+n, y), &screen,
199 Rpt(pt(x, y), pt(xmax-n+1, y+1)), S);
201 xtipple(Rpt(pt(x,y), pt(x+n, y+1)));
202 string(&screen, pt(x, y), font, buf, DxorS);
205 Rpt(pt(x,y),pt(x+n,y+1)),