On 14 Sep 2008 at 11:49, Michael B. Brutman wrote:
The backspace is an interesting problem. I've
interpreting ASCII 8 as a
backspace, which seems pretty normal to me. But a lot of clients are
sending ASCII 127. Telnet doesn't actually specify backspace as
required function. I need to do more research to see what the correct
behavior is.
Depends on the vintage of the implementation. BS originally was just
that--move the current printing/display position one back, erasing
nothing. 127 (Rubout/ASCII DEL) was used as a delete character
because it punched all the holes in a tape and was ignored on
printing as a fill character. (Many of us can still remember editing
paper tape using rubouts to delete previously punched characters).
The non-erasing interpretation of BS came as a surprise to me when
writing early text CRT terminal firmware. To form various
international characters, the client could send out the character for
an ogonek, then a BS, then, say, an A. The firmware had to display
the ogonek, move the cursor back a space, then combine the ogonek
with the A and display the ogonek-inflected-A. The reverse sequence
(A-BS-ogonek) also had to be honored. The purpose of this was to be
compatible with earlier printing terminals.
WikiP has the following on BS:
"The ambiguity surrounding Backspace comes from mismatches between
the intent of the human or software transmitting the Backspace and
the interpretation by the software receiving it. If the transmitter
expects Backspace to erase the previous character and the receiver
expects Delete to be used to erase the previous character, many
receivers will echo the Backspace as "^H", just as they would echo
any other uninterpreted control character. (A similar mismatch in the
other direction may yield Delete displayed as "^?".)"
So, it's your posion. I've used telnet servers that insist on RO to
erase characters and print ^H when backspace is received. OTOH, the
current Linux telnet server treats BS and DEL identically--and if I
were in your shoes, I'd do the same.
Cheers,
Chuck