The BS/DEL fiasco, was Re: [ng-spice-devel] Catching up


To ng-spice-devel@ieee.ing.uniroma1.it
From Al Davis <aldavis@ieee.org>
Date Mon, 5 Feb 2001 13:04:51 -0800
Delivered-To mailing list ng-spice-devel@ieee.ing.uniroma1.it
In-Reply-To <CF654D964573D311A1CA0090278A36FF4CBD76@EDIN_EXM1 >
Mailing-List contact ng-spice-devel-help@ieee.ing.uniroma1.it; run by ezmlm
References <CF654D964573D311A1CA0090278A36FF4CBD76@EDIN_EXM1 >
Reply-To ng-spice-devel@ieee.ing.uniroma1.it

I think Alan gets the prize for the most topics in a single email.  I 
will answer a few of them, one at a time.

To understand the BS/DEL problem, you must understand its history.

Turn back your calendars.  It is now late 1970's, let's pick 1978.

We had big computers, each with its own proprietary operating system. 
 Typically, they used some kind of cards or tape for long term 
storage.  Typically, human commumication was through some kind of 
external terminal.

We had the beginning of small computers, most likely 8080 based 
machines running any of several operating systems.  CP/M was the most 
popular, and making good progress at being a standard OS that would 
run hardware from many vendors.  Like the big machines, they used 
tape for long term storagem and an external terminal for human 
interaction.

We also had the beginning of unix, aiming mostly at research centers 
(Bell Labs) where a small group could have their own "mini" computer, 
perhaps a PDP-11 (DEC), still with those external terminals.  One 
"mini" could have perhaps 4 of those terminals, one for each member 
of the group.

The early terminals mimiced teletype machines, so were pretty simple. 
 In time, more features like cursor positioning were added.  Since 
they came from different vendors, they were all different in the way 
they did this.  The keyboard layouts came from typewriters, but there 
was a need for new keys that typewriters didn't have.  Again, they 
were all different in this.

One of the most annoying was the backspace and delete keys, a problem 
seems to be still a problem over 20 years later.  These keys moved 
around and were interpreted differently in different places.

The unix workaround for these terminal problems is the "termcap" 
program and library, and some configuration using a program "stty".

Using "stty" you can make any key act as a delete key.

Now, with Linux, and terminal EMULATORS, an emulator must choose 
which way to go, and you must set "stty" to match.

It is a non-issue with application programs, because they should all 
just use the standard library, or perhaps GNU readline.

A better solution would have been to always allow either, like bash 
in emacs mode does, or to allow more than one character to mean 
erase.  Too bad that didn't catch on.  The downside of having a 
program handle it is that it can add to the confusion by making it 
inconsistent.

Anyway, today it remains a big pain.  To deal with it, remember there 
are two places to set it...  the terminal emulator, and with "stty".  
You should set "stty" so it works correctly using a simple program 
like "cat".

You can also use "stty" to change some other keys.  For example, 
usually in unix, control-D is end of file.  If you prefer the DOS way 
(control-Z), you can change it.  Likewise, control-C and others.

"stty" exists to support that proliferation of incompatible terminals 
from the past.


Partial thread listing: