It was thus said that the Great Christopher Smith once
stated:
From: Raymond Moyers [mailto:rmoyers@nop.org]
Unix, for years, shipped with a editor nobody
could use
and backspace key that did not work, and seemed rigged
Hmm -- the backspace key has always worked for me, and the
editor, while being not incredibly nice, was useable.
Maybe now, but not always (and I still come across the occasional
problem). The problem lies with what do you use to back the cursor up one
position and delete the character that is there? BS (ASCII 8)? The proper
definition is to move the cursor left one position; nothing at all about
removing the character there. DEL (ASCII 127)? Again, the proper
definition is a character that is to be ignored (comes from paper tape I
believe, to erase or ignore a character on tape, you punch out all the
holes---thus it being defined as 127).
DEC decided to use DEL to back up one space and delete the character, and
this was carried over by the BSD guys. SysV (from AT&T) seemed to settle on
using BS for this function (as did Microsoft). All through college I was
always having to redefine what my terminal emulation program sent when I hit
the Backspace key or tell Unix what the backspace key is, depending on what
I could and couldn't do at the time.
Most, if not all Unices have a command "stty" that allow you to tell it what
key to interpret as the deleting backspace (and many other keys). I'm fairly
sure that this command was introduced in v7.
Eric
% stty -a
speed 9600 baud;
rows = 34 columns = 96; ypixels = 446 xpixels = 691
intr = ^c; quit = ^|; erase = ^?; kill = ^u;
eof = ^d; eol = <undef>; eol2 = <undef>; swtch = <undef>;
start = ^q; stop = ^s; susp = ^z; dsusp = ^y;
rprnt = ^r; flush = ^o; werase = ^w; lnext = ^v;
-parenb -parodd cs8 -cstopb -hupcl cread -clocal -loblk -parext
-ignbrk brkint ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl -iuclc
ixon -ixany -ixoff imaxbel
isig icanon -xcase echo echoe echok -echonl -noflsh
-tostop echoctl -echoprt echoke -defecho -flusho -pendin iexten
opost -olcuc onlcr -ocrnl -onocr -onlret -ofill -ofdel
% stty erase ^H
% stty -a
speed 9600 baud;
rows = 34 columns = 96; ypixels = 446 xpixels = 691
intr = ^c; quit = ^|; erase = ^h; kill = ^u;
eof = ^d; eol = <undef>; eol2 = <undef>; swtch = <undef>;
start = ^q; stop = ^s; susp = ^z; dsusp = ^y;
rprnt = ^r; flush = ^o; werase = ^w; lnext = ^v;
-parenb -parodd cs8 -cstopb -hupcl cread -clocal -loblk -parext
-ignbrk brkint ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl -iuclc
ixon -ixany -ixoff imaxbel
isig icanon -xcase echo echoe echok -echonl -noflsh
-tostop echoctl -echoprt echoke -defecho -flusho -pendin iexten
opost -olcuc onlcr -ocrnl -onocr -onlret -ofill -ofdel