static void tinsertblank(int);
static void tinsertblankline(int);
static void tmoveto(int, int);
static void tinsertblank(int);
static void tinsertblankline(int);
static void tmoveto(int, int);
static void tnew(int, int);
static void tnewline(int);
static void tputtab(bool);
static void tnew(int, int);
static void tnewline(int);
static void tputtab(bool);
term.mode = MODE_WRAP;
tclearregion(0, 0, term.col-1, term.row-1);
term.mode = MODE_WRAP;
tclearregion(0, 0, term.col-1, term.row-1);
+/* for absolute user moves, when decom is set */
+void
+tmoveato(int x, int y) {
+ tmoveto(x, y + ((term.c.state & CURSOR_ORIGIN) ? term.top: 0));
+}
+
break;
case 7: /* DECAWM -- Auto wrap */
MODBIT(term.mode, set, MODE_WRAP);
break;
break;
case 7: /* DECAWM -- Auto wrap */
MODBIT(term.mode, set, MODE_WRAP);
break;
- case 25:
- MODBIT(term.c.state, !set, CURSOR_HIDE);
+ case 25: /* DECTCEM -- Text Cursor Enable Mode */
+ MODBIT(term.mode, !set, MODE_HIDE);
break;
case 1000: /* 1000,1002: enable xterm mouse report */
MODBIT(term.mode, set, MODE_MOUSEBTN);
break;
case 1000: /* 1000,1002: enable xterm mouse report */
MODBIT(term.mode, set, MODE_MOUSEBTN);
tclearregion(0, 0, term.col-1, term.row-1);
tclearregion(0, 0, term.col-1, term.row-1);
DEFAULT(csiescseq.arg[0], 1);
tmoveto(term.c.x, term.c.y-csiescseq.arg[0]);
break;
case 'B': /* CUD -- Cursor <n> Down */
DEFAULT(csiescseq.arg[0], 1);
tmoveto(term.c.x, term.c.y-csiescseq.arg[0]);
break;
case 'B': /* CUD -- Cursor <n> Down */
DEFAULT(csiescseq.arg[0], 1);
tmoveto(term.c.x, term.c.y+csiescseq.arg[0]);
break;
DEFAULT(csiescseq.arg[0], 1);
tmoveto(term.c.x, term.c.y+csiescseq.arg[0]);
break;
ttywrite(VT102ID, sizeof(VT102ID) - 1);
break;
case 'C': /* CUF -- Cursor <n> Forward */
ttywrite(VT102ID, sizeof(VT102ID) - 1);
break;
case 'C': /* CUF -- Cursor <n> Forward */
DEFAULT(csiescseq.arg[0], 1);
tmoveto(term.c.x+csiescseq.arg[0], term.c.y);
break;
DEFAULT(csiescseq.arg[0], 1);
tmoveto(term.c.x+csiescseq.arg[0], term.c.y);
break;
case 'f': /* HVP */
DEFAULT(csiescseq.arg[0], 1);
DEFAULT(csiescseq.arg[1], 1);
case 'f': /* HVP */
DEFAULT(csiescseq.arg[0], 1);
DEFAULT(csiescseq.arg[1], 1);
break;
case 'I': /* CHT -- Cursor Forward Tabulation <n> tab stops */
DEFAULT(csiescseq.arg[0], 1);
break;
case 'I': /* CHT -- Cursor Forward Tabulation <n> tab stops */
DEFAULT(csiescseq.arg[0], 1);
break;
case 'd': /* VPA -- Move to <row> */
DEFAULT(csiescseq.arg[0], 1);
break;
case 'd': /* VPA -- Move to <row> */
DEFAULT(csiescseq.arg[0], 1);
break;
case 'h': /* SM -- Set terminal mode */
tsetmode(csiescseq.priv, 1, csiescseq.arg, csiescseq.narg);
break;
case 'h': /* SM -- Set terminal mode */
tsetmode(csiescseq.priv, 1, csiescseq.arg, csiescseq.narg);
DEFAULT(csiescseq.arg[0], 1);
DEFAULT(csiescseq.arg[1], term.row);
tsetscroll(csiescseq.arg[0]-1, csiescseq.arg[1]-1);
DEFAULT(csiescseq.arg[0], 1);
DEFAULT(csiescseq.arg[1], term.row);
tsetscroll(csiescseq.arg[0]-1, csiescseq.arg[1]-1);
- * STR sequences must be checked before of anything
- * because it can use some control codes as part of the sequence
+ * STR sequences must be checked before anything else
+ * because it can use some control codes as part of the sequence.
/*
* Actions of control codes must be performed as soon they arrive
* because they can be embedded inside a control sequence, and
/*
* Actions of control codes must be performed as soon they arrive
* because they can be embedded inside a control sequence, and
- case '\005': /* ENQ (IGNORED) */
- case '\000': /* NUL (IGNORED) */
- case '\021': /* XON (IGNORED) */
- case '\023': /* XOFF (IGNORED) */
- case 0177: /* DEL (IGNORED) */
+ case '\005': /* ENQ (IGNORED) */
+ case '\000': /* NUL (IGNORED) */
+ case '\021': /* XON (IGNORED) */
+ case '\023': /* XOFF (IGNORED) */
+ case 0177: /* DEL (IGNORED) */
int ic, ib, x, y, ox, sl;
Glyph base, new;
char buf[DRAW_BUF_SIZ];
int ic, ib, x, y, ox, sl;
Glyph base, new;
char buf[DRAW_BUF_SIZ];