diff --git a/src/apps/terminal/BasicTerminalBuffer.h b/src/apps/terminal/BasicTerminalBuffer.h index e581c97675e..60802bd3a10 100644 --- a/src/apps/terminal/BasicTerminalBuffer.h +++ b/src/apps/terminal/BasicTerminalBuffer.h @@ -124,6 +124,7 @@ class BasicTerminalBuffer { // insert chars/lines inline void InsertChar(UTF8Char c); void InsertChar(UTF8Char c, uint32 width); + inline void InsertChar(const char* c); inline void InsertChar(const char* c, int32 length); inline void InsertChar(const char* c, int32 length, uint32 width); @@ -279,6 +280,12 @@ BasicTerminalBuffer::InsertChar(UTF8Char c) } +void +BasicTerminalBuffer::InsertChar(const char* c) +{ + return InsertChar(UTF8Char(c), 1); +} + void BasicTerminalBuffer::InsertChar(const char* c, int32 length) { diff --git a/src/apps/terminal/TermParse.cpp b/src/apps/terminal/TermParse.cpp index f7fc346157e..21a060d04ef 100644 --- a/src/apps/terminal/TermParse.cpp +++ b/src/apps/terminal/TermParse.cpp @@ -51,8 +51,7 @@ extern int gIesTable[]; /* ignore ESC table */ extern int gEscIgnoreTable[]; /* ESC ignore table */ extern int gMbcsTable[]; /* ESC $ */ -extern int gLineDrawTable[]; /* ESC ( 0 */ - +extern const char* gLineDrawGraphSet[]; /* may be used for G0, G1, G2, G3 */ #define DEFAULT -1 #define NPARAM 10 // Max parameters @@ -388,9 +387,10 @@ TermParse::EscParse() int *groundtable = gUTF8GroundTable; int *parsestate = gUTF8GroundTable; - /* Handle switch between G0 and G1 character sets */ - int *alternateParseTable = gUTF8GroundTable; - bool shifted_in = false; + /* handle alternative character sets G0 - G4 */ + const char** graphSets[4] = { NULL, NULL, NULL, NULL }; + int curGL = 0; + int curGR = 0; int32 srcLen = sizeof(cbuf); int32 dstLen = sizeof(dstbuf); @@ -416,9 +416,20 @@ TermParse::EscParse() switch (parsestate[c]) { case CASE_PRINT: - fBuffer->InsertChar((char)c); + { + int curGS = c < 128 ? curGL : curGR; + const char** curGraphSet = graphSets[curGS]; + if (curGraphSet != NULL) { + int offset = c - (c < 128 ? 0x20 : 0xA0); + if (offset >= 0 && offset < 96 + && (curGraphSet[offset] != 0)) { + fBuffer->InsertChar(curGraphSet[offset]); + break; + } + } + fBuffer->InsertChar((char)(c)); break; - + } case CASE_PRINT_GR: /* case iso8859 gr character, or euc */ ptr = cbuf; @@ -485,91 +496,6 @@ TermParse::EscParse() fBuffer->InsertChar(dstbuf, dstLen); break; - case CASE_PRINT_GRA: - /* "Special characters and line drawing" enabled by \E(0 */ - switch (c) { - case '`': // ACS_DIAMOND - fBuffer->InsertChar("\xE2\x97\x86", 3); - break; - case 'a': // ACS_CKBOARD - fBuffer->InsertChar("\xE2\x96\x92", 3); - break; - case 'f': // ACS_DEGREE - fBuffer->InsertChar("\xC2\xB0", 2); - break; - case 'g': // ACS_PLMINUS - fBuffer->InsertChar("\xC2\xB1", 2); - break; - case 'i': // ACS_LANTERN - fBuffer->InsertChar("\xE2\x98\x83", 3); - break; - case 'j': // ACS_LRCORNER - fBuffer->InsertChar("\xE2\x94\x98", 3); - break; - case 'k': // ACS_URCORNER - fBuffer->InsertChar("\xE2\x94\x90", 3); - break; - case 'l': // ACS_ULCORNER - fBuffer->InsertChar("\xE2\x94\x8C", 3); - break; - case 'm': // ACS_LLCORNER - fBuffer->InsertChar("\xE2\x94\x94", 3); - break; - case 'n': // ACS_PLUS - fBuffer->InsertChar("\xE2\x94\xBC", 3); - break; - case 'o': // ACS_S1 - fBuffer->InsertChar("\xE2\x8E\xBA", 3); - break; - case 'p': // ACS_S3 - fBuffer->InsertChar("\xE2\x8E\xBB", 3); - break; - case 'r': // ACS_S7 - fBuffer->InsertChar("\xE2\x8E\xBC", 3); - break; - case 's': // ACS_S9 - fBuffer->InsertChar("\xE2\x8E\xBD", 3); - break; - case 'q': // ACS_HLINE - fBuffer->InsertChar("\xE2\x94\x80", 3); - break; - case 't': // ACS_LTEE - fBuffer->InsertChar("\xE2\x94\x9C", 3); - break; - case 'u': // ACS_RTEE - fBuffer->InsertChar("\xE2\x94\xA4", 3); - break; - case 'v': // ACS_BTEE - fBuffer->InsertChar("\xE2\x94\xB4", 3); - break; - case 'w': // ACS_TTEE - fBuffer->InsertChar("\xE2\x94\xAC", 3); - break; - case 'x': // ACS_VLINE - fBuffer->InsertChar("\xE2\x94\x82", 3); - break; - case 'y': // ACS_LEQUAL - fBuffer->InsertChar("\xE2\x89\xA4", 3); - break; - case 'z': // ACS_GEQUAL - fBuffer->InsertChar("\xE2\x89\xA5", 3); - break; - case '{': // ACS_PI - fBuffer->InsertChar("\xCF\x80", 2); - break; - case '|': // ACS_NEQUAL - fBuffer->InsertChar("\xE2\x89\xA0", 3); - break; - case '}': // ACS_STERLING - fBuffer->InsertChar("\xC2\xA3", 2); - break; - case '~': // ACS_BULLET - fBuffer->InsertChar("\xC2\xB7", 2); - default: - fBuffer->InsertChar((char)c); - } - break; - case CASE_LF: fBuffer->InsertLF(); break; @@ -639,26 +565,40 @@ TermParse::EscParse() case CASE_SCS_STATE: { - char page = _NextParseChar(); - - int* newTable = _GuessGroundTable(currentEncoding); - if (page == '0') - newTable = gLineDrawTable; - - if (c == '(') { - if (shifted_in) - alternateParseTable = newTable; - else - groundtable = newTable; - } else if (c == ')') { - if (!shifted_in) - alternateParseTable = newTable; - else - groundtable = newTable; + int set = -1; + switch (c) { + case '(': + set = 0; + break; + case ')': + case '-': + set = 1; + break; + case '*': + case '.': + set = 2; + break; + case '+': + case '/': + set = 3; + break; + default: + break; } - parsestate = groundtable; + if (set > -1) { + char page = _NextParseChar(); + switch (page) { + case '0': + graphSets[set] = gLineDrawGraphSet; + break; + default: + graphSets[set] = NULL; + break; + } + } + parsestate = groundtable; break; } @@ -698,22 +638,16 @@ TermParse::EscParse() /* Ignore character */ break; - case CASE_SI: - /* shift in (to G1 charset) */ - if (shifted_in == false) { - int* tmp = alternateParseTable; - alternateParseTable = parsestate; - parsestate = tmp; - } + case CASE_LS1: + /* select G1 into GL */ + curGL = 1; + parsestate = groundtable; break; - case CASE_SO: - /* shift out (to G0 charset) */ - if (shifted_in == true) { - int* tmp = alternateParseTable; - alternateParseTable = parsestate; - parsestate = tmp; - } + case CASE_LS0: + /* select G0 into GL */ + curGL = 0; + parsestate = groundtable; break; case CASE_SCR_STATE: // ESC # @@ -1199,32 +1133,32 @@ TermParse::EscParse() break; case CASE_LS2: - /* LS2 */ - // screen->curgl = 2; + /* select G2 into GL */ + curGL = 2; parsestate = groundtable; break; case CASE_LS3: - /* LS3 */ - // screen->curgl = 3; + /* select G3 into GL */ + curGL = 3; parsestate = groundtable; break; case CASE_LS3R: - /* LS3R */ - // screen->curgr = 3; + /* select G3 into GR */ + curGR = 3; parsestate = groundtable; break; case CASE_LS2R: - /* LS2R */ - // screen->curgr = 2; + /* select G2 into GR */ + curGR = 2; parsestate = groundtable; break; case CASE_LS1R: - /* LS1R */ - // screen->curgr = 1; + /* select G1 into GR */ + curGR = 1; parsestate = groundtable; break; diff --git a/src/apps/terminal/UTF8Char.h b/src/apps/terminal/UTF8Char.h index e8b50d46a4d..a981c003dec 100644 --- a/src/apps/terminal/UTF8Char.h +++ b/src/apps/terminal/UTF8Char.h @@ -23,6 +23,11 @@ struct UTF8Char { bytes[0] = c; } + UTF8Char(const char* c) + { + SetTo(c, ByteCount(*c)); + } + UTF8Char(const char* c, int32 count) { SetTo(c, count); diff --git a/src/apps/terminal/VTPrsTbl.c b/src/apps/terminal/VTPrsTbl.c index 0b711229ce2..2651100a13b 100644 --- a/src/apps/terminal/VTPrsTbl.c +++ b/src/apps/terminal/VTPrsTbl.c @@ -9,6 +9,8 @@ * Siarzhuk Zharski, zharik@gmx.li */ +#include + #include "VTparse.h" #define USE_MBCS @@ -35,8 +37,8 @@ CASE_LF, /* CASE_UP*/ /* NP CR SO SI */ CASE_LF, /* CASE_IGNORE*/ CASE_CR, -CASE_SO, -CASE_SI, +CASE_LS1, +CASE_LS0, /* DLE DC1 DC2 DC3 */ CASE_IGNORE, CASE_IGNORE, @@ -360,8 +362,8 @@ CASE_LF, /* CASE_UP*/ /* NP CR SO SI */ CASE_LF, /* CASE_IGNORE*/ CASE_CR, -CASE_SO, -CASE_SI, +CASE_LS1, +CASE_LS0, /* DLE DC1 DC2 DC3 */ CASE_IGNORE, CASE_IGNORE, @@ -685,8 +687,8 @@ CASE_LF, /*CASE_UP,*/ /* NP CR SO SI */ CASE_LF, /*CASE_IGNORE,*/ CASE_CR, -CASE_SO, -CASE_SI, +CASE_LS1, +CASE_LS0, /* DLE DC1 DC2 DC3 */ CASE_IGNORE, CASE_IGNORE, @@ -1010,8 +1012,8 @@ CASE_LF, /*CASE_UP,*/ /* NP CR SO SI */ CASE_LF, /*CASE_IGNORE,*/ CASE_CR, -CASE_SO, -CASE_SI, +CASE_LS1, +CASE_LS0, /* DLE DC1 DC2 DC3 */ CASE_IGNORE, CASE_IGNORE, @@ -1335,8 +1337,8 @@ CASE_VMOT, /* NP CR SO SI */ CASE_VMOT, CASE_CR, -CASE_SO, -CASE_SI, +CASE_LS1, +CASE_LS0, /* DLE DC1 DC2 DC3 */ CASE_IGNORE, CASE_IGNORE, @@ -1660,8 +1662,8 @@ CASE_VMOT, /* NP CR SO SI */ CASE_VMOT, CASE_CR, -CASE_SO, -CASE_SI, +CASE_LS1, +CASE_LS0, /* DLE DC1 DC2 DC3 */ CASE_IGNORE, CASE_IGNORE, @@ -2002,8 +2004,8 @@ CASE_VMOT, /* NP CR SO SI */ CASE_VMOT, CASE_CR, -CASE_SO, -CASE_SI, +CASE_LS1, +CASE_LS0, /* DLE DC1 DC2 DC3 */ CASE_IGNORE, CASE_IGNORE, @@ -2328,8 +2330,8 @@ CASE_LF, /*CASE_UP,*/ /* NP CR SO SI */ CASE_LF, /*CASE_IGNORE,*/ CASE_CR, -CASE_SO, -CASE_SI, +CASE_LS1, +CASE_LS0, /* DLE DC1 DC2 DC3 */ CASE_IGNORE, CASE_IGNORE, @@ -3321,8 +3323,8 @@ CASE_VMOT, /* NP CR SO SI */ CASE_VMOT, CASE_CR, -CASE_SO, -CASE_SI, +CASE_LS1, +CASE_LS0, /* DLE DC1 DC2 DC3 */ CASE_IGNORE, CASE_IGNORE, @@ -3646,8 +3648,8 @@ CASE_VMOT, /* NP CR SO SI */ CASE_VMOT, CASE_CR, -CASE_SO, -CASE_SI, +CASE_LS1, +CASE_LS0, /* DLE DC1 DC2 DC3 */ CASE_IGNORE, CASE_IGNORE, @@ -4074,8 +4076,8 @@ CASE_VMOT, /* NP CR SO SI */ CASE_VMOT, CASE_CR, -CASE_SO, -CASE_SI, +CASE_LS1, +CASE_LS0, /* DLE DC1 DC2 DC3 */ CASE_IGNORE, CASE_IGNORE, @@ -4398,8 +4400,8 @@ CASE_VMOT, /* NP CR SO SI */ CASE_VMOT, CASE_CR, -CASE_SO, -CASE_SI, +CASE_LS1, +CASE_LS0, /* DLE DC1 DC2 DC3 */ CASE_IGNORE, CASE_IGNORE, @@ -4725,8 +4727,8 @@ CASE_LF, /*CASE_UP,*/ /* NP CR SO SI */ CASE_LF, /*CASE_IGNORE,*/ CASE_CR, -CASE_SO, -CASE_SI, +CASE_LS1, +CASE_LS0, /* DLE DC1 DC2 DC3 */ CASE_IGNORE, CASE_IGNORE, @@ -5029,328 +5031,158 @@ CASE_SJIS_INSTRING, CASE_SJIS_INSTRING, }; +/* + * 94/96 alternative character sets for G0-G3 + * + * - characters to replace are UTF-8 literals + * - NULL mean falling through to corresponding ASCII chars + * + */ -// #pragma mark Line drawing table -int gLineDrawTable[] = +/* DEC Special Graphic Character Set - mix of xterm + definitions and ncurses extended characters (ACS_) */ +const char* gLineDrawGraphSet[96] = { -/* NUL SOH STX ETX */ -CASE_IGNORE, -CASE_IGNORE, -CASE_IGNORE, -CASE_IGNORE, -/* EOT ENQ ACK BEL */ -CASE_IGNORE, -CASE_IGNORE, -CASE_IGNORE, -CASE_BELL, -/* BS HT NL VT */ -CASE_BS, -CASE_TAB, -CASE_LF, -CASE_LF, /* CASE_UP*/ -/* NP CR SO SI */ -CASE_LF, /* CASE_IGNORE*/ -CASE_CR, -CASE_SO, -CASE_SI, -/* DLE DC1 DC2 DC3 */ -CASE_IGNORE, -CASE_IGNORE, -CASE_IGNORE, -CASE_IGNORE, -/* DC4 NAK SYN ETB */ -CASE_IGNORE, -CASE_IGNORE, -CASE_IGNORE, -CASE_IGNORE, -/* CAN EM SUB ESC */ -CASE_IGNORE, -CASE_IGNORE, -CASE_IGNORE, -CASE_ESC, -/* FS GS RS US */ -CASE_IGNORE, -CASE_IGNORE, -CASE_IGNORE, -CASE_IGNORE, -/* SP ! " # */ -CASE_PRINT, -CASE_PRINT, -CASE_PRINT, -CASE_PRINT, -/* $ % & ' */ -CASE_PRINT, -CASE_PRINT, -CASE_PRINT, -CASE_PRINT, -/* ( ) * + */ -CASE_PRINT, -CASE_PRINT, -CASE_PRINT, -CASE_PRINT, -/* , - . / */ -CASE_PRINT, -CASE_PRINT, -CASE_PRINT, -CASE_PRINT, -/* 0 1 2 3 */ -CASE_PRINT, -CASE_PRINT, -CASE_PRINT, -CASE_PRINT, -/* 4 5 6 7 */ -CASE_PRINT, -CASE_PRINT, -CASE_PRINT, -CASE_PRINT, -/* 8 9 : ; */ -CASE_PRINT, -CASE_PRINT, -CASE_PRINT, -CASE_PRINT, -/* < = > ? */ -CASE_PRINT, -CASE_PRINT, -CASE_PRINT, -CASE_PRINT, -/* @ A B C */ -CASE_PRINT, -CASE_PRINT, -CASE_PRINT, -CASE_PRINT, -/* D E F G */ -CASE_PRINT, -CASE_PRINT, -CASE_PRINT, -CASE_PRINT, -/* H I J K */ -CASE_PRINT, -CASE_PRINT, -CASE_PRINT, -CASE_PRINT, -/* L M N O */ -CASE_PRINT, -CASE_PRINT, -CASE_PRINT, -CASE_PRINT, -/* P Q R S */ -CASE_PRINT, -CASE_PRINT, -CASE_PRINT, -CASE_PRINT, -/* T U V W */ -CASE_PRINT, -CASE_PRINT, -CASE_PRINT, -CASE_PRINT, -/* X Y Z [ */ -CASE_PRINT, -CASE_PRINT, -CASE_PRINT, -CASE_PRINT, -/* \ ] ^ _ */ -CASE_PRINT, -CASE_PRINT, -CASE_PRINT, -CASE_PRINT, -/* ` a b c */ -CASE_PRINT_GRA, -CASE_PRINT_GRA, -CASE_PRINT, -CASE_PRINT, -/* d e f g */ -CASE_PRINT, -CASE_PRINT, -CASE_PRINT_GRA, -CASE_PRINT_GRA, -/* h i j k */ -CASE_PRINT, -CASE_PRINT_GRA, -CASE_PRINT_GRA, -CASE_PRINT_GRA, -/* l m n o */ -CASE_PRINT_GRA, -CASE_PRINT_GRA, -CASE_PRINT_GRA, -CASE_PRINT, -/* p q r s */ -CASE_PRINT, -CASE_PRINT_GRA, -CASE_PRINT, -CASE_PRINT, -/* t u v w */ -CASE_PRINT_GRA, -CASE_PRINT_GRA, -CASE_PRINT_GRA, -CASE_PRINT_GRA, -/* x y z { */ -CASE_PRINT_GRA, -CASE_PRINT_GRA, -CASE_PRINT_GRA, -CASE_PRINT_GRA, -/* | } ~ DEL */ -CASE_PRINT_GRA, -CASE_PRINT_GRA, -CASE_PRINT_GRA, -CASE_IGNORE, -/* 0x80 0x81 0x82 0x83 */ -CASE_UTF8_INSTRING, -CASE_UTF8_INSTRING, -CASE_UTF8_INSTRING, -CASE_UTF8_INSTRING, -/* 0x84 0x85 0x86 0x87 */ -CASE_UTF8_INSTRING, -CASE_UTF8_INSTRING, -CASE_UTF8_INSTRING, -CASE_UTF8_INSTRING, -/* 0x88 0x89 0x8a 0x8b */ -CASE_UTF8_INSTRING, -CASE_UTF8_INSTRING, -CASE_UTF8_INSTRING, -CASE_UTF8_INSTRING, -/* 0x8c 0x8d 0x8e 0x8f */ -CASE_UTF8_INSTRING, -CASE_UTF8_INSTRING, -CASE_UTF8_INSTRING, -CASE_UTF8_INSTRING, -/* 0x90 0x91 0x92 0x93 */ -CASE_UTF8_INSTRING, -CASE_UTF8_INSTRING, -CASE_UTF8_INSTRING, -CASE_UTF8_INSTRING, -/* 0x94 0x95 0x96 0x97 */ -CASE_UTF8_INSTRING, -CASE_UTF8_INSTRING, -CASE_UTF8_INSTRING, -CASE_UTF8_INSTRING, -/* 0x99 0x99 0x9a 0x9b */ -CASE_UTF8_INSTRING, -CASE_UTF8_INSTRING, -CASE_UTF8_INSTRING, -CASE_UTF8_INSTRING, -/* 0x9c 0x9d 0x9e 0x9f */ -CASE_UTF8_INSTRING, -CASE_UTF8_INSTRING, -CASE_UTF8_INSTRING, -CASE_UTF8_INSTRING, -/* 0xa0 0xa1 0xa2 0xa3 */ -CASE_UTF8_INSTRING, -CASE_UTF8_INSTRING, -CASE_UTF8_INSTRING, -CASE_UTF8_INSTRING, -/* 0xa4 0xa5 0xa6 0xa7 */ -CASE_UTF8_INSTRING, -CASE_UTF8_INSTRING, -CASE_UTF8_INSTRING, -CASE_UTF8_INSTRING, -/* 0xa8 0xa9 0xaa 0xab */ -CASE_UTF8_INSTRING, -CASE_UTF8_INSTRING, -CASE_UTF8_INSTRING, -CASE_UTF8_INSTRING, -/* 0xac 0xad 0xae 0xaf */ -CASE_UTF8_INSTRING, -CASE_UTF8_INSTRING, -CASE_UTF8_INSTRING, -CASE_UTF8_INSTRING, -/* 0xb0 0xb1 0xb2 0xb3 */ -CASE_UTF8_INSTRING, -CASE_UTF8_INSTRING, -CASE_UTF8_INSTRING, -CASE_UTF8_INSTRING, -/* 0xb4 0xb5 0xb6 0xb7 */ -CASE_UTF8_INSTRING, -CASE_UTF8_INSTRING, -CASE_UTF8_INSTRING, -CASE_UTF8_INSTRING, -/* 0xb8 0xb9 0xba 0xbb */ -CASE_UTF8_INSTRING, -CASE_UTF8_INSTRING, -CASE_UTF8_INSTRING, -CASE_UTF8_INSTRING, -/* 0xbc 0xbd 0xbe 0xbf */ -CASE_UTF8_INSTRING, -CASE_UTF8_INSTRING, -CASE_UTF8_INSTRING, -CASE_UTF8_INSTRING, -/* 0xc0 0xc1 0xc2 0xc3 */ -CASE_UTF8_2BYTE, -CASE_UTF8_2BYTE, -CASE_UTF8_2BYTE, -CASE_UTF8_2BYTE, -/* 0xc4 0xc5 0xc6 0xc7 */ -CASE_UTF8_2BYTE, -CASE_UTF8_2BYTE, -CASE_UTF8_2BYTE, -CASE_UTF8_2BYTE, -/* 0xc8 0xc9 0xca 0xcb */ -CASE_UTF8_2BYTE, -CASE_UTF8_2BYTE, -CASE_UTF8_2BYTE, -CASE_UTF8_2BYTE, -/* 0xcc 0xcd 0xce 0xcf */ -CASE_UTF8_2BYTE, -CASE_UTF8_2BYTE, -CASE_UTF8_2BYTE, -CASE_UTF8_2BYTE, -/* 0xd0 0xd1 0xd2 0xd3 */ -CASE_UTF8_2BYTE, -CASE_UTF8_2BYTE, -CASE_UTF8_2BYTE, -CASE_UTF8_2BYTE, -/* 0xd4 0xd5 0xd6 0xd7 */ -CASE_UTF8_2BYTE, -CASE_UTF8_2BYTE, -CASE_UTF8_2BYTE, -CASE_UTF8_2BYTE, -/* 0xd8 0xd9 0xda 0xdb */ -CASE_UTF8_2BYTE, -CASE_UTF8_2BYTE, -CASE_UTF8_2BYTE, -CASE_UTF8_2BYTE, -/* 0xdc 0xdd 0xde 0xdf */ -CASE_UTF8_2BYTE, -CASE_UTF8_2BYTE, -CASE_UTF8_2BYTE, -CASE_UTF8_2BYTE, -/* 0xe0 0xe1 0xe2 0xe3 */ -CASE_UTF8_3BYTE, -CASE_UTF8_3BYTE, -CASE_UTF8_3BYTE, -CASE_UTF8_3BYTE, -/* 0xe4 0xe5 0xe6 0xe7 */ -CASE_UTF8_3BYTE, -CASE_UTF8_3BYTE, -CASE_UTF8_3BYTE, -CASE_UTF8_3BYTE, -/* 0xe8 0xe9 0xea 0xeb */ -CASE_UTF8_3BYTE, -CASE_UTF8_3BYTE, -CASE_UTF8_3BYTE, -CASE_UTF8_3BYTE, -/* 0xec 0xed 0xee 0xef */ -CASE_UTF8_3BYTE, -CASE_UTF8_3BYTE, -CASE_UTF8_3BYTE, -CASE_UTF8_3BYTE, -/* 0xf0 0xf1 0xf2 0xf3 */ -CASE_UTF8_3BYTE, -CASE_UTF8_3BYTE, -CASE_UTF8_3BYTE, -CASE_UTF8_3BYTE, -/* 0xf4 0xf5 0xf6 0xf7 */ -CASE_UTF8_3BYTE, -CASE_UTF8_3BYTE, -CASE_UTF8_3BYTE, -CASE_UTF8_3BYTE, -/* 0xf8 0xf9 0xfa 0xfb */ -CASE_UTF8_3BYTE, -CASE_UTF8_3BYTE, -CASE_UTF8_3BYTE, -CASE_UTF8_3BYTE, -/* 0xfc 0xfd 0xfe 0xff */ -CASE_UTF8_3BYTE, -CASE_UTF8_3BYTE, -CASE_UTF8_3BYTE, -CASE_UTF8_3BYTE, +// SP ! " # +NULL, +NULL, +NULL, +NULL, + +// $ % & ' +NULL, +NULL, +NULL, +NULL, + +// ( ) * + +NULL, +NULL, +NULL, +"\xE2\x86\x92", // ACS_RARROW + +// , - . / +"\xE2\x86\x90", // ACS_LARROW +"\xE2\x86\x91", // ACS_UARROW +"\xE2\x86\x93", // ACS_DARROW +NULL, + +// 0 1 2 3 +"\xE2\x96\xAE", // ACS_BLOCK +NULL, +NULL, +NULL, + +// 4 5 6 7 +NULL, +NULL, +NULL, +NULL, + +// 8 9 : ; +NULL, +NULL, +NULL, +NULL, + +// < = > ? +NULL, +NULL, +NULL, +NULL, + +// @ A B C +NULL, +NULL, +NULL, +NULL, + +// D E F G +NULL, +NULL, +NULL, +NULL, + +// H I J K +NULL, +NULL, +NULL, +NULL, + +// L M N O +NULL, +NULL, +NULL, +NULL, + +// P Q R S +NULL, +NULL, +NULL, +NULL, + +// T U V W +NULL, +NULL, +NULL, +NULL, + +// X Y Z [ +NULL, +NULL, +NULL, +NULL, +// \ ] ^ _ +NULL, +NULL, +NULL, +"\xE2\x96\xAE", // xterm: black vertical rectangle + +// ` a b c +"\xE2\x97\x86", // ACS_DIAMOND +"\xE2\x96\x92", // ACS_CKBOARD +"\xE2\x90\x89", // xterm:symbol for horizontal tabulation +"\xE2\x90\x8C", // xterm:symbol for form feed + +// d e f g +"\xE2\x90\x8D", // xterm:symbol for carriage return +"\xE2\x90\x8A", // xterm:symbol for line feed +"\xC2\xB0", // ACS_DEGREE +"\xC2\xB1", // ACS_PLMINUS + +// h i j k +"\xE2\x90\xA4", // xterm:symbol for newline (ACS_BOARD) +"\xE2\x98\x83", // ACS_LANTERN (xterm:symbol for vert.tab: \xE2\x90\x8B) +"\xE2\x94\x98", // ACS_LRCORNER +"\xE2\x94\x90", // ACS_URCORNER + +// l m n o +"\xE2\x94\x8C", // ACS_ULCORNER +"\xE2\x94\x94", // ACS_LLCORNER +"\xE2\x94\xBC", // ACS_PLUS +"\xE2\x8E\xBA", // ACS_S1 + +// p q r s +"\xE2\x8E\xBB", // ACS_S3 +"\xE2\x94\x80", // ACS_HLINE +"\xE2\x8E\xBC", // ACS_S7 +"\xE2\x8E\xBD", // ACS_S9 + +// t u v w +"\xE2\x94\x9C", // ACS_LTEE +"\xE2\x94\xA4", // ACS_RTEE +"\xE2\x94\xB4", // ACS_BTEE +"\xE2\x94\xAC", // ACS_TTEE + +// x y z { +"\xE2\x94\x82", // ACS_VLINE +"\xE2\x89\xA4", // ACS_LEQUAL +"\xE2\x89\xA5", // ACS_GEQUAL +"\xCF\x80", // ACS_PI + +// | } ~ DEL +"\xE2\x89\xA0", // ACS_NEQUAL +"\xC2\xA3", // ACS_STERLING +"\xC2\xB7", // ACS_BULLET +NULL }; diff --git a/src/apps/terminal/VTparse.h b/src/apps/terminal/VTparse.h index e2f6da19a62..da48dd124f1 100644 --- a/src/apps/terminal/VTparse.h +++ b/src/apps/terminal/VTparse.h @@ -21,8 +21,8 @@ #define CASE_VMOT 8 #define CASE_TAB 9 #define CASE_LF 10 -#define CASE_SI 11 -#define CASE_SO 12 +#define CASE_LS0 11 +#define CASE_LS1 12 #define CASE_SP 13 #define CASE_SCR_STATE 14 #define CASE_SCS0_STATE 15 @@ -105,6 +105,5 @@ #define CASE_SD 90 /* scroll screen down */ #define CASE_ECH 91 /* erase characters */ -#define CASE_PRINT_GRA 92 #define CASE_DECSCUSR_ETC 93 #define CASE_CSI_SP 94