ASCII control characters in my terminal

(jvns.ca)

28 points | by ingve 4 days ago ago

4 comments

  • kps 4 days ago

    > There’s no real structure to which codes are in which categories, they’re all just kind of randomly scattered

    Not exactly. Although the 1967 revision muddled things a little, they are grouped by kind:¹

        A8.2 The controls that were selected logically fall into four groups:
          (1) Transmission controls
          (2) Format effectors
          (3) Device controls
          (4) Information separators
        Within each group the controls are ordered so that the binary
        and hierarchical order are directly related.
    
    ‘Format effectors’ are the controls that move the carriage/printhead/cursor, and ‘device controls’ are basically private-use format effectors (which mostly followed Teletype's and linger as ^S/^Q flow control).

    ¹ https://www.sensitiveresearch.com/Archive/CharCodeHist/X3.4-...

  • kps 3 days ago

    There are some other ‘well akshually’ remarks I could make, but the root of today's mess is that Unix started with ASCII terminal interaction, but Linux desktops too heavily imitated Microsoft Window, for which the Control key has unrelated conflicting overloads.

  • euroderf 2 days ago

    Hey hold on a minute. I thought the codes that are (in the article's chart) 28, 29, 30, 31 are respectively FS, GS, RS, US.

    • TristanBall 7 hours ago

      Yup.

      And teaching yourself and your tools to use them as delimiters is damn near a superpower for semi-structured/tabular text forms ( aka csv/tsv and co ).

      Issues with field definition, escaping, and embedded newlines all but go away.. newlines being the harder ones because some tools just insist on being line based and will hard code variants of cr/lf as newlines.

      And they retain their meaning and uniqueness in utf8 ( true of all the ascii control codes ), which is an under appreciated feature imnsho.