STATE_OTHER,
STATE_ESCAPE,
STATE_CSI,
- STATE_CSO,
+ STATE_OSC,
} state = STATE_OTHER;
_cleanup_(memstream_done) MemStream m = {};
size_t isz, shift[2] = {}, n_carriage_returns = 0;
*
* 1. Replaces TABs by 8 spaces
* 2. Strips ANSI color sequences (a subset of CSI), i.e. ESC '[' … 'm' sequences
- * 3. Strips ANSI operating system sequences (CSO), i.e. ESC ']' … BEL sequences
+ * 3. Strips ANSI operating system sequences (OSC), i.e. ESC ']' … BEL sequences
* 4. Strip trailing \r characters (since they would "move the cursor", but have no
* other effect).
*
* are any other special characters. Truncated ANSI sequences are left-as is too. This call is
* supposed to suppress the most basic formatting noise, but nothing else.
*
- * Why care for CSO sequences? Well, to undo what terminal_urlify() and friends generate. */
+ * Why care for OSC sequences? Well, to undo what terminal_urlify() and friends generate. */
isz = _isz ? *_isz : strlen(*ibuf);
} else if (*i == '[') { /* ANSI CSI */
state = STATE_CSI;
begin = i + 1;
- } else if (*i == ']') { /* ANSI CSO */
- state = STATE_CSO;
+ } else if (*i == ']') { /* ANSI OSC */
+ state = STATE_OSC;
begin = i + 1;
} else {
fputc('\x1B', f);
break;
- case STATE_CSO:
+ case STATE_OSC:
assert(n_carriage_returns == 0);
if (i >= *ibuf + isz || /* EOT … */