From 2c4af8728dc7614fc3c329d3a172cc33e57dab01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sat, 14 Dec 2019 20:28:05 +0100 Subject: [PATCH] vt: add commented out cases for 8-bit C1 control characters XTerm seems to ignore these when in UTF-8 mode. Since we _only_ support UTF-8, we don't need to recognize these control characters at all. However, it may be good to have them here for reference. So add them, but commented out, along with their corresponding 7-bit versions (which we _do_ recognize and implement). --- vt.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/vt.c b/vt.c index f1adc5f6..38ce9f5f 100644 --- a/vt.c +++ b/vt.c @@ -850,6 +850,11 @@ action(struct terminal *term, enum action _action, uint8_t c) case ACTION_EXECUTE: LOG_DBG("execute: 0x%02x", c); switch (c) { + + /* + * 7-bit C0 control characters + */ + case '\0': break; @@ -903,6 +908,36 @@ action(struct terminal *term, enum action _action, uint8_t c) term->charsets.selected = 0; /* G0 */ break; + /* + * 8-bit C1 control characters + * + * We ignore these, but keep them here for reference, along + * with their corresponding 7-bit variants. + * + * As far as I can tell, XTerm also ignores these _when in + * UTF-8 mode_. Which would be the normal mode of operation + * these days. And since we _only_ support UTF-8... + */ +#if 0 + case '\x84': /* IND -> ESC D */ + case '\x85': /* NEL -> ESC E */ + case '\x88': /* Tab Set -> ESC H */ + case '\x8d': /* RI -> ESC M */ + case '\x8e': /* SS2 -> ESC N */ + case '\x8f': /* SS3 -> ESC O */ + case '\x90': /* DCS -> ESC P */ + case '\x96': /* SPA -> ESC V */ + case '\x97': /* EPA -> ESC W */ + case '\x98': /* SOS -> ESC X */ + case '\x9a': /* DECID -> ESC Z (obsolete form of CSI c) */ + case '\x9b': /* CSI -> ESC [ */ + case '\x9c': /* ST -> ESC \ */ + case '\x9d': /* OSC -> ESC ] */ + case '\x9e': /* PM -> ESC ^ */ + case '\x9f': /* APC -> ESC _ */ + break; +#endif + default: break; }