1. 3
  1.  

  2. 1

    With that domain I would’ve expected not to have to scroll to the bottom ;)

    otherwise, nice job!

    1. 1

      As some advice to the author, I originally mistook this for a submission of a much older article, since I didn’t look at the submission information; my point is that perhaps drastically different imagery would’ve prevented this, as I believe the article I mention used at least one of the same images. This is tangential and an arguable point, however.

      Anyway, the article mentions UNIX and is tagged with that, but that doesn’t mean ASCII is actually related to UNIX.

      The exact meaning of control characters has varied greatly over the years (which is why extensive termcap databases are required).

      This article would be improved by mentioning ECMA-48 by name. Anyway, I was disappointed, but not surprised, to see the UNIX method portrayed as the only solution. Follows is an excerpt from ’‘The UNIX-HATERS Handbook’’:

      As soon as more than one company started selling VDTs, software engineers faced an immediate problem: different manufacturers used different control sequences to accomplish similar functions. Programmers had to find a way to deal with the differences.

      Programmers at the revered Digital Equipment Corporation took a very simple-minded approach to solving the heterogenous terminal problem. Since their company manufactured both hardware and software, they simply didn’t support terminals made by any other manufacturer. They then hard-coded algorithms for displaying information on the standard DEC VT52 (then the VT100, VT102, an so on) into their VMS operating system, application programs, scripts, mail messages, and any other system string that they could get their hands on.

      At the MIT AI Laboratory, a different solution was developed. Instead of teaching each application program how to display information on the user’s screen, these algorithms were built into the ITS operating system itself. A special input/output subsystem within the Lab’s ITS kernel kept track of every character displayed on the user’s screen and automatically handled the differences between different terminals. Adding a new kind of terminal only required teaching ITS the terminal’s screen size, control characters, and operating characteristics, and suddenly every existing application would work on the new terminal without modification.

      Unix (through the hand of Bill Joy) took a third approach. The techniques for manipulating a video display terminal were written and bundled together into a library, but then this library, instead of being linked into the kernel where it belonged (or put in a shared library), was linked with every single application program. When bugs were discovered in the so-called termcap library, the programs that were built from termcap had to be relinked (and occasionally recompiled). Because the screen was managed on a per-application basis, different applications couldn’t interoperate on the same screen. Instead, each one assumed that it had complete control (not a bad assumption, given the state of Unix at that time.) And, perhaps most importantly, the Unix kernel still thought that it was displaying information on a conventional teletype.

      Now, returning back to your article:

      This is kind of neat and well designed, but for us it means:

      There is no way to see if the user pressed only Control or Shift, because from a terminal’s perspective all they do is modify a bit for the typed character.

      Yes, this complicates advanced key-chords; a good test is seeing if Emacs differentiates; if not, then it’s unlikely it can reasonably be done.

      There is no way to distinguish between the Tab key and Control+i. It’s not just ‘the same’ as Tab, Control+i is Tab.

      Yes, I’d to explain this to one fellow in teaching him a design for a terminal control library I’ve written. This is another disadvantage of using control.

      Sending Control with a character from the 2nd column is useless. Control clears the 7th bit, but this is already 0, so Control+# will just send “#”.

      Yes, that’s the last main issue with it. It’s noteworthy that the Meta or Alt key avoids this issue; you can configure some terminals to set the eight bit or prefix with the Escape character, but those that can’t be configured use the latter convention; this is one of many issues with comprehensively parsing more advanced terminal input, but it does have the nice property of lacking these special cases the Control key has. Mentioning Meta or Alt would’ve perhaps been a good idea.

      1. 2

        As some advice to the author, I originally mistook this for a submission of a much older article, since I didn’t look at the submission information; my point is that perhaps drastically different imagery would’ve prevented this, as I believe the article I mention used at least one of the same images.

        I’m not sure which older article you mean? I just wrote this because it’s a common question/source of confusion, and frustration with how shit asciitable.com is (still first hit on Google :-/).

        This article would be improved by mentioning ECMA-48 by name. Anyway, I was disappointed, but not surprised, to see the UNIX method portrayed as the only solution.

        I linked to https://en.wikipedia.org/wiki/ANSI_escape_code for now.

        The page isn’t intended to give a full and comprehensive overview of all the history; it explicitly mentions that “many aspects have been omitted”. My only goal was to provide exactly enough information for people to understand why CTRL+I sends a tab character, and why they can’t remap it in Vim etc. Nothing more.

        This is also why it just talks about Unix. Unix still exists and is what many people use. VMS and ITS? Not so much…

        Mentioning Meta or Alt would’ve perhaps been a good idea.

        It’s mentioned briefly (“This is also how the Alt key works: Alt+a is <Esc>a.”). To be honest, I was tempted to not even include the entire section about escape sequences at all, since it doesn’t directly pertain to the question I wanted to answer. I mainly included it to make sure people wouldn’t be confused and think F1 or the arrow keys are control codes.