summaryrefslogtreecommitdiffstats
path: root/src/parser.l
diff options
context:
space:
mode:
Diffstat (limited to 'src/parser.l')
-rw-r--r--src/parser.l49
1 files changed, 44 insertions, 5 deletions
diff --git a/src/parser.l b/src/parser.l
index 7471074..c11d87f 100644
--- a/src/parser.l
+++ b/src/parser.l
@@ -198,10 +198,18 @@ static void vt100_parser_handle_text(VT100Screen *vt, char *text, size_t len);
}
{OSC}{CHAR}*{ST} {
- yytext[yyleng - 1] = '\0';
- fprintf(stderr,
- "unhandled OSC sequence: \\033%s\\007\n",
- yytext + 1);
+ if (!strncmp(yytext, "\e]50;", 5)) { // osx terminal.app private stuff
+ // not interested in non-portable extensions
+ }
+ else if (!strncmp(yytext, "\e]499;", 5)) { // termcast private metadata
+ // this isn't intended to be interpreted
+ }
+ else {
+ yytext[yyleng - 1] = '\0';
+ fprintf(stderr,
+ "unhandled OSC sequence: \\033%s\\007\n",
+ yytext + 1);
+ }
}
{ESC}{CTRL} {
@@ -209,7 +217,15 @@ static void vt100_parser_handle_text(VT100Screen *vt, char *text, size_t len);
}
{ESC}{CHAR} {
- fprintf(stderr, "unhandled escape sequence: %s\n", yytext + 1);
+ switch (yytext[1]) {
+ case '(': // character sets
+ // not interested in implementing character sets, unicode should be
+ // sufficient
+ break;
+ default:
+ fprintf(stderr, "unhandled escape sequence: %s\n", yytext + 1);
+ break;
+ }
}
{CTRL} {
@@ -526,6 +542,16 @@ static void vt100_parser_handle_sm(VT100Screen *vt, char *buf, size_t len)
case 2004:
vt100_screen_set_bracketed_paste(vt);
break;
+ case 12: // blinking cursor
+ // not interested in blinking cursors
+ case 1005: // UTF-8 mouse tracking mode
+ // will just default this to always on. might break some
+ // programs, but the programs that will break will already be
+ // broken for terms with width greater than 223.
+ case 1034: // interpret Meta key
+ // not actually sure if ignoring this is correct - need to see
+ // what exactly it does. don't think it's important though.
+ break;
default:
fprintf(stderr,
"unknown SM parameter: %c%d\n", modes[i], params[i]);
@@ -585,6 +611,16 @@ static void vt100_parser_handle_rm(VT100Screen *vt, char *buf, size_t len)
case 2004:
vt100_screen_reset_bracketed_paste(vt);
break;
+ case 12: // blinking cursor
+ // not interested in blinking cursors
+ case 1005: // UTF-8 mouse tracking mode
+ // will just default this to always on. might break some
+ // programs, but the programs that will break will already be
+ // broken for terms with width greater than 223.
+ case 1034: // interpret Meta key
+ // not actually sure if ignoring this is correct - need to see
+ // what exactly it does. don't think it's important though.
+ break;
default:
fprintf(stderr,
"unknown RM parameter: %c%d\n", modes[i], params[i]);
@@ -738,6 +774,9 @@ static void vt100_parser_handle_sgr(VT100Screen *vt, char *buf, size_t len)
case 104: case 105: case 106: case 107:
vt100_screen_set_bg_color(vt, params[i] - 92);
break;
+ case 5: // blink mode
+ // blinking terminals are awful
+ break;
default:
fprintf(stderr, "unknown SGR parameter: %d\n", params[i]);
break;