X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=st.c;h=bd0c59ebfbd088d2f0a076231c084b663ac158a7;hb=17290f493b3701f57f1e8a1f2d26fc12ab968928;hp=9a979ea6b128a1aed8818f67976b890773ea0209;hpb=3764f38fc805a8846bd18f1d555a10227fd14e29;p=st.git diff --git a/st.c b/st.c index 9a979ea..bd0c59e 100644 --- a/st.c +++ b/st.c @@ -394,6 +394,7 @@ static void tsetmode(bool, bool, int *, int); static void tfulldirt(void); static void techo(char *, int); static bool tcontrolcode(uchar ); +static void tdectest(char ); static int32_t tdefcolor(int *, int *, int); static void tselcs(void); static void tdeftran(char); @@ -2086,8 +2087,8 @@ csihandle(void) { len = snprintf(buf, sizeof(buf),"\033[%i;%iR", term.c.y+1, term.c.x+1); ttywrite(buf, len); - break; } + break; case 'r': /* DECSTBM -- Set Scrolling Region */ if(csiescseq.priv) { goto unknown; @@ -2426,6 +2427,19 @@ tcontrolcode(uchar ascii) { } void +tdectest(char c) { + static char E[UTF_SIZ] = "E"; + int x, y; + + if(c == '8') { /* DEC screen alignment test. */ + for(x = 0; x < term.col; ++x) { + for(y = 0; y < term.row; ++y) + tsetchar(E, &term.c.attr, x, y); + } + } +} + +void tputc(char *c, int len) { uchar ascii; bool control; @@ -2504,15 +2518,7 @@ tputc(char *c, int len) { tdeftran(ascii); tselcs(); } else if(term.esc & ESC_TEST) { - if(ascii == '8') { /* DEC screen alignment test. */ - char E[UTF_SIZ] = "E"; - int x, y; - - for(x = 0; x < term.col; ++x) { - for(y = 0; y < term.row; ++y) - tsetchar(E, &term.c.attr, x, y); - } - } + tdectest(ascii); } else { switch(ascii) { case '[':