X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=st.c;h=d2261e22fe7bc9b0439386afc066e9533e34edbc;hb=02d2df5790d186f16e0e22becd8107a85f328c2f;hp=297eb3f812c3a54efd80ab59ece742c722aadcf7;hpb=7f1e02e4dbb6e6f033797a09a7deea4fe29f2ca6;p=st.git diff --git a/st.c b/st.c index 297eb3f..d2261e2 100644 --- a/st.c +++ b/st.c @@ -2298,7 +2298,7 @@ techo(char *buf, int len) { for(; len > 0; buf++, len--) { char c = *buf; - if(c < 0x20 || c == 0177) { /* control code */ + if(BETWEEN(c, 0x00, 0x1f) || c == 0x7f) { /* control code */ if(c != '\n' && c != '\r' && c != '\t') { c ^= '\x40'; tputc("^", 1); @@ -2452,10 +2452,6 @@ tputc(char *c, int len) { csiparse(); csihandle(); } - } else if(term.esc & ESC_STR_END) { - term.esc = 0; - if(ascii == '\\') - strhandle(); } else if(term.esc & ESC_ALTCHARSET) { tdeftran(ascii); tselcs(); @@ -2545,7 +2541,9 @@ tputc(char *c, int len) { tcursor(CURSOR_LOAD); term.esc = 0; break; - case '\\': /* ST -- Stop */ + case '\\': /* ST -- String Terminator */ + if(term.esc & ESC_STR_END) + strhandle(); term.esc = 0; break; default: