X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=st.c;h=2919082c79a95b5320b8f231124fba5a6d39f897;hb=5d5a7c627a3709c3758c516de87609bb6b518e13;hp=657fba7309c1d8839a89c2c037256ff24f525a3b;hpb=5260a9ea2249b9159c188a6e27a39a38d131e411;p=st.git diff --git a/st.c b/st.c index 657fba7..2919082 100644 --- a/st.c +++ b/st.c @@ -1459,6 +1459,7 @@ tsetscroll(int t, int b) { void tsetmode(bool priv, bool set, int *args, int narg) { int *lim, mode; + bool alt; for(lim = args + narg; args < lim; ++args) { if(priv) { @@ -1480,9 +1481,14 @@ tsetmode(bool priv, bool set, int *args, int narg) { case 7: /* DECAWM -- Auto wrap */ MODBIT(term.mode, set, MODE_WRAP); break; - case 8: /* XXX: DECARM -- Auto repeat */ - break; case 0: /* Error (IGNORED) */ + case 2: /* DECANM -- ANSI/VT52 (IGNORED) */ + case 3: /* DECCOLM -- Column (IGNORED) */ + case 4: /* DECSCLM -- Scroll (IGNORED) */ + case 8: /* DECARM -- Auto repeat (IGNORED) */ + case 18: /* DECPFF -- Printer feed (IGNORED) */ + case 19: /* DECPEX -- Printer extent (IGNORED) */ + case 42: /* DECNRCM -- National characters (IGNORED) */ case 12: /* att610 -- Start blinking cursor (IGNORED) */ break; case 25: /* DECTCEM -- Text Cursor Enable Mode */ @@ -1497,7 +1503,7 @@ tsetmode(bool priv, bool set, int *args, int narg) { case 1049: /* = 1047 and 1048 */ case 47: case 1047: { - bool alt = IS_SET(MODE_ALTSCREEN) != 0; + alt = IS_SET(MODE_ALTSCREEN) != 0; if(alt) tclearregion(0, 0, term.col-1, term.row-1); if(set ^ alt) /* set is always 1 or 0 */ @@ -1510,12 +1516,6 @@ tsetmode(bool priv, bool set, int *args, int narg) { tcursor((set) ? CURSOR_SAVE : CURSOR_LOAD); break; default: - /* case 2: DECANM -- ANSI/VT52 (NOT SUPPOURTED) */ - /* case 3: DECCOLM -- Column (NOT SUPPORTED) */ - /* case 4: DECSCLM -- Scroll (NOT SUPPORTED) */ - /* case 18: DECPFF -- Printer feed (NOT SUPPORTED) */ - /* case 19: DECPEX -- Printer extent (NOT SUPPORTED) */ - /* case 42: DECNRCM -- National characters (NOT SUPPORTED) */ fprintf(stderr, "erresc: unknown private set/reset mode %d\n", *args); @@ -1562,11 +1562,11 @@ csihandle(void) { tinsertblank(csiescseq.arg[0]); break; case 'A': /* CUU -- Cursor Up */ - case 'e': DEFAULT(csiescseq.arg[0], 1); tmoveto(term.c.x, term.c.y-csiescseq.arg[0]); break; case 'B': /* CUD -- Cursor Down */ + case 'e': /* VPR --Cursor Down */ DEFAULT(csiescseq.arg[0], 1); tmoveto(term.c.x, term.c.y+csiescseq.arg[0]); break; @@ -1575,7 +1575,7 @@ csihandle(void) { ttywrite(VT102ID, sizeof(VT102ID) - 1); break; case 'C': /* CUF -- Cursor Forward */ - case 'a': + case 'a': /* HPR -- Cursor Forward */ DEFAULT(csiescseq.arg[0], 1); tmoveto(term.c.x+csiescseq.arg[0], term.c.y); break;