aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto E. Vargas Caballero <k0ga@shike2.com>2014-06-20 09:51:18 +0200
committerRoberto E. Vargas Caballero <k0ga@shike2.com>2014-07-08 23:32:28 +0200
commit984c12d2a67fd19ee69b35152d93de8cb67595e8 (patch)
tree50c21bd4dd9b0bbc274286b0704ffeb2d6c36355
parentda78629cf5fa234204f002ff2c2b597a2bf7e76f (diff)
downloadst-984c12d2a67fd19ee69b35152d93de8cb67595e8.tar.gz
st-984c12d2a67fd19ee69b35152d93de8cb67595e8.zip
Add 8 bit version of DCS, APC, PM, OSC
DCS, APC, PM, OSC version for 7 bits environments already was implemented in st. This patch adds the 8 bit version of it.
-rw-r--r--st.c39
1 files changed, 32 insertions, 7 deletions
diff --git a/st.c b/st.c
index 6ec4858..b221f33 100644
--- a/st.c
+++ b/st.c
@@ -405,6 +405,7 @@ static void ttyread(void);
405static void ttyresize(void); 405static void ttyresize(void);
406static void ttysend(char *, size_t); 406static void ttysend(char *, size_t);
407static void ttywrite(const char *, size_t); 407static void ttywrite(const char *, size_t);
408static void tstrsequence(uchar c);
408 409
409static void xdraws(char *, Glyph, int, int, int, int); 410static void xdraws(char *, Glyph, int, int, int, int);
410static void xhints(void); 411static void xhints(void);
@@ -2348,6 +2349,30 @@ tdeftran(char ascii) {
2348} 2349}
2349 2350
2350void 2351void
2352tstrsequence(uchar c) {
2353 if (c & 0x80) {
2354 switch (c) {
2355 case 0x90: /* DCS -- Device Control String */
2356 c = 'P';
2357 break;
2358 case 0x9f: /* APC -- Application Program Command */
2359 c = '_';
2360 break;
2361 case 0x9e: /* PM -- Privacy Message */
2362 c = '^';
2363 break;
2364 case 0x9d: /* OSC -- Operating System Command */
2365 c = ']';
2366 break;
2367 }
2368 }
2369 strreset();
2370 strescseq.type = c;
2371 term.esc |= ESC_STR;
2372 return;
2373}
2374
2375void
2351tcontrolcode(uchar ascii) { 2376tcontrolcode(uchar ascii) {
2352 static char question[UTF_SIZ] = "?"; 2377 static char question[UTF_SIZ] = "?";
2353 2378
@@ -2411,7 +2436,6 @@ tcontrolcode(uchar ascii) {
2411 case 0x8d: /* TODO: RI */ 2436 case 0x8d: /* TODO: RI */
2412 case 0x8e: /* TODO: SS2 */ 2437 case 0x8e: /* TODO: SS2 */
2413 case 0x8f: /* TODO: SS3 */ 2438 case 0x8f: /* TODO: SS3 */
2414 case 0x90: /* TODO: DCS */
2415 case 0x98: /* TODO: SOS */ 2439 case 0x98: /* TODO: SOS */
2416 break; 2440 break;
2417 case 0x9a: /* DECID -- Identify Terminal */ 2441 case 0x9a: /* DECID -- Identify Terminal */
@@ -2419,10 +2443,13 @@ tcontrolcode(uchar ascii) {
2419 break; 2443 break;
2420 case 0x9b: /* TODO: CSI */ 2444 case 0x9b: /* TODO: CSI */
2421 case 0x9c: /* TODO: ST */ 2445 case 0x9c: /* TODO: ST */
2422 case 0x9d: /* TODO: OSC */
2423 case 0x9e: /* TODO: PM */
2424 case 0x9f: /* TODO: APC */
2425 break; 2446 break;
2447 case 0x90: /* DCS -- Device Control String */
2448 case 0x9f: /* APC -- Application Program Command */
2449 case 0x9e: /* PM -- Privacy Message */
2450 case 0x9d: /* OSC -- Operating System Command */
2451 tstrsequence(ascii);
2452 return;
2426 } 2453 }
2427 /* only CAN, SUB, \a and C1 chars interrupt a sequence */ 2454 /* only CAN, SUB, \a and C1 chars interrupt a sequence */
2428 term.esc &= ~(ESC_STR_END|ESC_STR); 2455 term.esc &= ~(ESC_STR_END|ESC_STR);
@@ -2538,9 +2565,7 @@ tputc(char *c, int len) {
2538 case '^': /* PM -- Privacy Message */ 2565 case '^': /* PM -- Privacy Message */
2539 case ']': /* OSC -- Operating System Command */ 2566 case ']': /* OSC -- Operating System Command */
2540 case 'k': /* old title set compatibility */ 2567 case 'k': /* old title set compatibility */
2541 strreset(); 2568 tstrsequence(ascii);
2542 strescseq.type = ascii;
2543 term.esc |= ESC_STR;
2544 return; 2569 return;
2545 case '(': /* set primary charset G0 */ 2570 case '(': /* set primary charset G0 */
2546 case ')': /* set secondary charset G1 */ 2571 case ')': /* set secondary charset G1 */