2

./configure --help: --enable-8bitctrls enable 8 bit control sequences (not recommended)

As far as I can tell, the only affected code is this part of src/command.C:

/*{{{ process non-printing single characters */
void ecb_hot
rxvt_term::process_nonprinting (unicode_t ch)
{
  switch (ch)
    {
//
// skipping non-relevant lines
//
#ifdef EIGHT_BIT_CONTROLS
      // 8-bit controls
      case 0x90:        /* DCS */
        process_dcs_seq ();
        break;
      case 0x9b:        /* CSI */
        process_csi_seq ();
        break;
      case 0x9d:        /* OSC */
        process_osc_seq ();
        break;
#endif
    }
}
/*}}} */    

So, I suppose the problem is not with rvxt-unicode code itself. What bad things could happen if 8-bit control sequences are enabled?

  • bytes with the 8th bit set are used for non-ASCII characters (all charset in locales of most Unix-like systems being supersets of ASCII). So using that would only make sense for people in the US using ASCII-only locales and dealing with American-English only text. – Stéphane Chazelas Mar 06 '24 at 19:53
  • There are 10s of thousands of characters in Unicode whose UTF-8 encoding contains the 0x9b byte. CSI can also be expressed as the ESC [ sequence and that's what most applications use. (like in \e[1m to turn on bold mode) – Stéphane Chazelas Mar 06 '24 at 20:08
  • More generally the C1 control character set is mostly obsolete these days with hardly anything still using it. – Stéphane Chazelas Mar 06 '24 at 20:09
  • See also: https://en.wikipedia.org/wiki/ANSI_escape_code#Fe_Escape_sequences – Stéphane Chazelas Mar 06 '24 at 20:12
  • 1
    Perhaps you will provide a script which counts the "10s of thousands", so that others can compare results. – Thomas Dickey Mar 07 '24 at 00:35
  • @ThomasDickey no need for a script — 0x9B is 0b10011011, and since it starts with 0b10, it can appear as bytes 2, 3, and/or 4 in a 2–4-byte UTF-8 sequence. That gives 2⁵ code points with 2 bytes, ~2¹¹ with 3, and ~2¹⁶ with 4 if my calculations are correct, i.e. getting on for 70,000 code points. – Stephen Kitt Mar 07 '24 at 06:13

0 Answers0