1. 30
  1.  

    1. 3

      The short answer to “why does the backspace key send $7F Delete rather than $08 Backspace” is “your terminal emulator emulates the VT220 terminal, and that’s how it behaved.

    2. 3

      Controlling terminals is fraught with lore and near infinite exceptions.

      The only surprise is that a definitive tome is not listed.

      1. 2

        I think the closest you can get to a definitive tome is the termcap/terminfo databases.

    3. 1

      I wonder why there is an eol AND an eol2 and why both of them are undef.

      stty man page says

             eof CHAR
                    CHAR will send an end of file (terminate the input)
      
             eol CHAR
                    CHAR will end the line
      
             * eol2 CHAR
                    alternate CHAR for ending the line
      

      where the * before eol2 indicates non POSIX settings; but it does not elaborate any more :(

      1. 1

        The reason you don’t need them is because linux always treats \n as newline in line processing and with icrnl enabled (by default) if your keyboard emits \r you will get \n before line processing.

        Once upon a time, ASCII keyboards could often send a different character for the return keys on the number pad versus the “main” keyboard, or have a special “submit” or “send” key (instead of sending an escape sequence). Unix’s kernel-side line editor didn’t have much use for those keys, so users might configure stty to treat them as newlines rather than reconfigure their terminal (which they might use to connect to non-unix systems or to run interactive applications).

        1. 1

          Ah makes sense, it is for backwards compatibility for very old nonstandard keyboards. Thanks :D