aboutsummaryrefslogtreecommitdiff
path: root/st.c
diff options
context:
space:
mode:
Diffstat (limited to 'st.c')
-rw-r--r--st.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/st.c b/st.c
index 3ed77e1..7474256 100644
--- a/st.c
+++ b/st.c
@@ -392,7 +392,7 @@ static void tsetdirtattr(int);
392static void tsetmode(bool, bool, int *, int); 392static void tsetmode(bool, bool, int *, int);
393static void tfulldirt(void); 393static void tfulldirt(void);
394static void techo(char *, int); 394static void techo(char *, int);
395static bool tcontrolcode(uchar ); 395static void tcontrolcode(uchar );
396static void tdectest(char ); 396static void tdectest(char );
397static int32_t tdefcolor(int *, int *, int); 397static int32_t tdefcolor(int *, int *, int);
398static void tdeftran(char); 398static void tdeftran(char);
@@ -2328,7 +2328,7 @@ tdeftran(char ascii) {
2328 term.trantbl[term.icharset] = (*bp)[1]; 2328 term.trantbl[term.icharset] = (*bp)[1];
2329} 2329}
2330 2330
2331bool 2331void
2332tcontrolcode(uchar ascii) { 2332tcontrolcode(uchar ascii) {
2333 static char question[UTF_SIZ] = "?"; 2333 static char question[UTF_SIZ] = "?";
2334 2334
@@ -2363,7 +2363,7 @@ tcontrolcode(uchar ascii) {
2363 csireset(); 2363 csireset();
2364 term.esc &= ~(ESC_CSI|ESC_ALTCHARSET|ESC_TEST); 2364 term.esc &= ~(ESC_CSI|ESC_ALTCHARSET|ESC_TEST);
2365 term.esc |= ESC_START; 2365 term.esc |= ESC_START;
2366 return 1; 2366 return;
2367 case '\016': /* SO */ 2367 case '\016': /* SO */
2368 term.charset = 0; 2368 term.charset = 0;
2369 break; 2369 break;
@@ -2395,11 +2395,9 @@ tcontrolcode(uchar ascii) {
2395 case 0x9e: /* TODO: PM */ 2395 case 0x9e: /* TODO: PM */
2396 case 0x9f: /* TODO: APC */ 2396 case 0x9f: /* TODO: APC */
2397 break; 2397 break;
2398 default:
2399 return 0;
2400 } 2398 }
2401 term.esc &= ~(ESC_STR_END|ESC_STR); 2399 term.esc &= ~(ESC_STR_END|ESC_STR);
2402 return 1; 2400 return;
2403} 2401}
2404 2402
2405void 2403void
@@ -2478,8 +2476,11 @@ tputc(char *c, int len) {
2478 * they must not cause conflicts with sequences. 2476 * they must not cause conflicts with sequences.
2479 */ 2477 */
2480 if(control) { 2478 if(control) {
2481 if (tcontrolcode(ascii)) 2479 tcontrolcode(ascii);
2482 return; 2480 /*
2481 * control codes are not shown ever
2482 */
2483 return;
2483 } else if(term.esc & ESC_START) { 2484 } else if(term.esc & ESC_START) {
2484 if(term.esc & ESC_CSI) { 2485 if(term.esc & ESC_CSI) {
2485 csiescseq.buf[csiescseq.len++] = ascii; 2486 csiescseq.buf[csiescseq.len++] = ascii;
@@ -2576,11 +2577,6 @@ tputc(char *c, int len) {
2576 */ 2577 */
2577 return; 2578 return;
2578 } 2579 }
2579 /*
2580 * Display control codes only if we are in graphic mode
2581 */
2582 if(control && term.trantbl[term.charset] != CS_GRAPHIC0)
2583 return;
2584 if(sel.ob.x != -1 && BETWEEN(term.c.y, sel.ob.y, sel.oe.y)) 2580 if(sel.ob.x != -1 && BETWEEN(term.c.y, sel.ob.y, sel.oe.y))
2585 selclear(NULL); 2581 selclear(NULL);
2586 2582