[comp.editors] destructive backspace on vi

psrc@cbnewsl.att.com (paul.s.r.chisholm) (09/04/90)

In article <1990Aug30.224234.19582@ecst.csuchico.edu>, dbar@csuchico.edu (David Barrett) writes:
> When I use a screen editor, I like a "destructive backspace" (you
> back up and the character under the cursor disappears).  Previous
> versions of vi that I have used (on AT&T [systems] for example) have
> had this feature, I think. . . .  [In my current version,] backspace
> apparently is nondestructive and can't be altered by ordinary
> users.

Every version of vi I've used has a non-destructive backspace, both in
input mode, and when editing text on the bottom line in "colon" mode.
In fact, the documentation lists this as a feature, "so you can see
what you had typed" (or words to that effect).  (Also, destructive
backspace when inserting can be quite demanding, depending on how your
terminal does such things.  Yes, I know, every PC editor in the world
does this.  PC video access and UNIX(R) system terminal access aren't
the same; and if you want details or argument on this point, please use
e-mail.)  Your sysadmin is correct:  you'd need access to the source
code to change this.

> All the vi literature I have read says that the erase function can
> be linked to the key of your choice with the command "stty erase
> [char]" . . . .  I do this on [my] system and I get a destructive
> backspace for commands from the login shell mapped to the key of my
> choice.  Likewise for the ex editor.  But in vi, d.b.s. is against
> the rules.  Why is this?

Because full screen applications don't let the tty driver do such
handling; they do it themselves.  In fact, vi treats both backspace and
your current erase character (when you enter vi) as non-destructive
backspaces.  It does not, however, honor or reproduce the effect of the
"echoe" bit.

Paul S. R. Chisholm, AT&T Bell Laboratories
att!mtunq!psrc, psrc@mtunq.att.com, AT&T Mail !psrchisholm
I'm not speaking for the company, I'm just speaking my mind.
UNIX is a registered trademark of UNIX System Laboratories, Inc.,
a subsidiary of AT&T.

(P.S.:  Yes, comp.editors would be a better place to discuss this.
I've e-mailed the original author this reply, and moved discussion to
the editors newsgroup.)

brown@vidiot.UUCP (Vidiot) (09/06/90)

In article <1990Sep4.023335.28883@cbnewsl.att.com> psrc@mtunq.att.com (Paul S. R. Chisholm) writes:
<In article <1990Aug30.224234.19582@ecst.csuchico.edu>, dbar@csuchico.edu (David Barrett) writes:
<> When I use a screen editor, I like a "destructive backspace" (you
<> back up and the character under the cursor disappears).  Previous
<> versions of vi that I have used (on AT&T [systems] for example) have
<> had this feature, I think. . . .  [In my current version,] backspace
<> apparently is nondestructive and can't be altered by ordinary
<> users.
<
<Every version of vi I've used has a non-destructive backspace, both in
<input mode, and when editing text on the bottom line in "colon" mode.
<In fact, the documentation lists this as a feature, "so you can see
<what you had typed" (or words to that effect).  (Also, destructive
<backspace when inserting can be quite demanding, depending on how your
<terminal does such things.  Yes, I know, every PC editor in the world
<does this.  PC video access and UNIX(R) system terminal access aren't
<the same; and if you want details or argument on this point, please use
<e-mail.)  Your sysadmin is correct:  you'd need access to the source
<code to change this.

While it is true that the character doesn't "vanish", when the backspace
is pressed, while in input (edit) mode, the characters are no longer valid.
I find it very handy to see what I had typed previously, making it easier
to type over the same characters, changing only those that were incorrect.
Of course this falls apart when the mistake doesn't equate out when typing
in new characters.  In this case I just ignore it.

In any event it has never been a problem for me.  One just gets used to the
operation over the years.
-- 
      harvard\     att!nicmad\        spool.cs.wisc.edu!astroatc!vidiot!brown
Vidiot  ucbvax!uwvax..........!astroatc!vidiot!brown
      rutgers/  decvax!nicmad/ INET:<@spool.cs.wisc.edu,@astroatc:brown@vidiot>