Backspace key becomes ^H in mail, man, etc; DEL key becomes ^[[3

Backspace key becomes ^H in mail, man, etc; DEL key becomes ^[[3

Post by Al » Tue, 23 Oct 2001 21:59:14



I've read some(most?) of the FAQ's on using the Backspace/DEL key,
but I think my problem is a little different and I'd be grateful for any
help.
Generally, running bash in an xterm, the Backspace/DEL keys works the
way I want it
to work. Same for vi.
However, in MOST command-line applications such as openssl, mail, man,
nslookup
the backspace key becomes a ^H instead of erasing the character before
the cursor
which is pretty annoying, especially since the DEL key turns into its
escape code
^[[3 for these same apps - no way to delete anything.
Does anybody know the solution to this problem or at least where to
start looking?

Thanks

Al

 
 
 

Backspace key becomes ^H in mail, man, etc; DEL key becomes ^[[3

Post by thunde » Tue, 23 Oct 2001 23:56:57




> I've read some(most?) of the FAQ's on using the Backspace/DEL key,
> but I think my problem is a little different and I'd be grateful for
> any help.
> Generally, running bash in an xterm, the Backspace/DEL keys works
> the way I want it
> to work. Same for vi.
> However, in MOST command-line applications such as openssl, mail,
> man, nslookup
> the backspace key becomes a ^H instead of erasing the character
> before the cursor
> which is pretty annoying, especially since the DEL key turns into
> its escape code
> ^[[3 for these same apps - no way to delete anything. Does anybody
> know the solution to this problem or at least where to start
> looking?

> Thanks

> Al

http://igloo.its.unimelb.edu.au/Webmail/tips/msg00238.html

 
 
 

Backspace key becomes ^H in mail, man, etc; DEL key becomes ^[[3

Post by Michael Lee Yoh » Wed, 24 Oct 2001 02:01:36


Quote:> However, in MOST command-line applications such as openssl, mail, man,
> nslookup
> the backspace key becomes a ^H instead of erasing the character before

stty erase ^H

Your "erase" field is set to something different.  The above will
correct this (and is pretty safe to add to your login script).

--


Software Developer, Engineering Services
Red Hat, Inc.

QUIPd 0.20: (441 of 531)
-> A celebrity is a person who works hard all his life to become well
-> known, then wears dark glasses to avoid being recognized.
-> - Fred Allen

 
 
 

Backspace key becomes ^H in mail, man, etc; DEL key becomes ^[[3

Post by Bill Unr » Wed, 24 Oct 2001 06:44:02



]> However, in MOST command-line applications such as openssl, mail, man,
]> nslookup
]> the backspace key becomes a ^H instead of erasing the character before

]stty erase ^H

Unfortunately the "standard" in Linux has now become ^? for erase rather than
^H. The above is one of the indictions of having the backspace key send out ^H
but something else expecting something else.

]Your "erase" field is set to something different.  The above will
]correct this (and is pretty safe to add to your login script).

You should then also make sure that the rest of your system also expects ^H as
the erase key ( eg the command line, X, etc)

The whole handling of erase is a complete mess.

 
 
 

Backspace key becomes ^H in mail, man, etc; DEL key becomes ^[[3

Post by Skylar Thomps » Wed, 24 Oct 2001 06:15:45



>I've read some(most?) of the FAQ's on using the Backspace/DEL key,
>but I think my problem is a little different and I'd be grateful for any
>help.
>Generally, running bash in an xterm, the Backspace/DEL keys works the
>way I want it
>to work. Same for vi.
>However, in MOST command-line applications such as openssl, mail, man,
>nslookup
>the backspace key becomes a ^H instead of erasing the character before
>the cursor
>which is pretty annoying, especially since the DEL key turns into its
>escape code
>^[[3 for these same apps - no way to delete anything.
>Does anybody know the solution to this problem or at least where to
>start looking?

Do "stty erase ^H" (without the quotes) on the command line. If you want
behavior like that whenever you log in, put it in your ~/.bash_profile
file (or whatever profile file your shell happens to use).

--

P(4.2.2) + "Skylar DXLIX" DMPo L:36 DL:2500' A++ R+++ Sp w:Stormbringer
A(JLE)*/P*/Z/J64/Ad L/O H+ D+ c f-/f PV+ s TT- d++/d+ P++ M/M+
C- S++ I+/I++ So B+ ac GHB++ SQ++ RQ+ V+ F:JLE F: Possessors strong again

 
 
 

Backspace key becomes ^H in mail, man, etc; DEL key becomes ^[[3

Post by Villy Kru » Wed, 24 Oct 2001 15:25:57


On 22 Oct 2001 21:44:02 GMT,

Quote:

>Unfortunately the "standard" in Linux has now become ^? for erase rather than
>^H. The above is one of the indictions of having the backspace key send out ^H
>but something else expecting something else.

That has always been the standard for the linux console and this standard
has been copied from good old DEC vt100 terminals.  This standard is nice
for emacs users which now has ctrl-H available for other purposes.

So if TERM is set to linux or vtxxx set stty erase '^?'; otherwise set
stty erase '^H'.  This should cover most of the cases.

Villy

 
 
 

Backspace key becomes ^H in mail, man, etc; DEL key becomes ^[[3

Post by Al » Wed, 24 Oct 2001 23:14:30


In fact, ^? was used and ^H was expected by cmdline apps.
I suppose the fix may be to have bash interpret the correct
backspace/erase key using inputrc to have them work within shells,
and leave everything outside the way it is?

I'm a little confused as to the use of stty because it seems
to have no effect here within bash.

BTW I'm using RedHat 7.1.

Al.



> ]> However, in MOST command-line applications such as openssl, mail, man,
> ]> nslookup
> ]> the backspace key becomes a ^H instead of erasing the character before

> ]stty erase ^H

> Unfortunately the "standard" in Linux has now become ^? for erase rather than
> ^H. The above is one of the indictions of having the backspace key send out ^H
> but something else expecting something else.

> ]Your "erase" field is set to something different.  The above will
> ]correct this (and is pretty safe to add to your login script).

> You should then also make sure that the rest of your system also expects ^H as
> the erase key ( eg the command line, X, etc)

> The whole handling of erase is a complete mess.

 
 
 

Backspace key becomes ^H in mail, man, etc; DEL key becomes ^[[3

Post by Steffen Klu » Thu, 25 Oct 2001 00:43:47



>In fact, ^? was used and ^H was expected by cmdline apps.
>I suppose the fix may be to have bash interpret the correct
>backspace/erase key using inputrc to have them work within shells,
>and leave everything outside the way it is?

Bash is actually one of the few apps that work around the
ambiguity and do the right thing in any case. Login (on Linux) is
another one.

Most other apps require the stty setting to agree with what the
terminal (emulator) really sends. Usually, apps honour whatever
"stty erase" is set to. Only few apps read the keyboard directly,
and they can't be helped anyway.

To find out what your terminal sends you could say "cat >
/dev/null" and then type something, followed by <BackSpace>,
<Del> and Ctrl-H, to see what gets send. If any of those rubs out
the character to the left, then you've found what "stty -a" will
show as the "erase" character.

You need to make the terminal and stty agree on the erase
character, then you'll be fine. Unfortunately, not all terminal
emulators use the same erase character by default. Some come with
confusing options, like gnome-terminal, which offers you the
check boxes:
- Swap Delete/Backspace
- Delete generates DEL/^H

Go figure...

Cheers
Steffen.

 
 
 

Backspace key becomes ^H in mail, man, etc; DEL key becomes ^[[3

Post by Bill Unr » Thu, 25 Oct 2001 02:19:20



]On 22 Oct 2001 21:44:02 GMT,

]>
]>Unfortunately the "standard" in Linux has now become ^? for erase rather than
]>^H. The above is one of the indictions of having the backspace key send out ^H
]>but something else expecting something else.
]>

]That has always been the standard for the linux console and this standard
No it hasn't.
]has been copied from good old DEC vt100 terminals.  This standard is nice
Yes, I know. and it was a disaster.
]for emacs users which now has ctrl-H available for other purposes.
Now? Emacs was written back in the days when terminals were 1 baud teletype
devices. Its baleful influence on too many things has long been legend.
The Ascii standard for Backspace is ^H. That emacs used it for help was stupid,
and a remnant of those ancient pdp11 days when DEC decided to produce
proprietary non-standard keyboards (because DEC knew best).
;-)

]So if TERM is set to linux or vtxxx set stty erase '^?'; otherwise set
]stty erase '^H'.  This should cover most of the cases.

 
 
 

Backspace key becomes ^H in mail, man, etc; DEL key becomes ^[[3

Post by Donald Arsenea » Thu, 25 Oct 2001 12:21:27



> and a remnant of those ancient pdp11 days when DEC decided to produce
> proprietary non-standard keyboards (because DEC knew best).

DEC keyboards had both backspace and delete keys.

TRADITIONALLY, backspace moved the cursor to the left, with
no erase, and delete erased the character under the cursor.(*)

DEC made the delete key perform <backspace><delete>, although
it was configurable on some systems.

(*) The traditional delete character was actually ignored.  It
worked by punching out every hole on the paper tape, "over-punching"
whatever character may have been there.)


 
 
 

Backspace key becomes ^H in mail, man, etc; DEL key becomes ^[[3

Post by OldUncle » Sat, 27 Oct 2001 01:09:30


It was: Mon, 22 Oct 2001 14:59:14 +0200  and with STARTLING insight,
"Backspace key" to "comp.os.linux.misc" :

Problem is a bit different:  I use VT100 terminal emulation for telnet/ssh
client, TeraTerm.  I log into a Redhat Linux 6.0 much updated box.  It is
my own testbed, so I have root privileges if they are required.  My main
uses are command line operations and programs.

Primarily in bash2 and in VIM, I would like the delete key to remove the
character where the prompt is or the next one to the right if at the
beginning of a line.  Currently, DEL acts the same as BACKSPACE by deleting
to the left of prompt if in editing mode in VIM or command line of bash, or
moving to the left if not in an editing mode.  DEL, of my dreams, would
move to the right if in a non-editing mode, as in VIM or other
applications.

Would someone please suggest a cure for this?  Thanks,      /ts

--

"If you can just get your mind together
 Then come on across to me...."  Jimi

 
 
 

Backspace key becomes ^H in mail, man, etc; DEL key becomes ^[[3

Post by David Efflan » Sat, 27 Oct 2001 14:38:31



> It was: Mon, 22 Oct 2001 14:59:14 +0200  and with STARTLING insight,
> "Backspace key" to "comp.os.linux.misc" :

> Problem is a bit different:  I use VT100 terminal emulation for telnet/ssh
> client, TeraTerm.  I log into a Redhat Linux 6.0 much updated box.  It is
> my own testbed, so I have root privileges if they are required.  My main
> uses are command line operations and programs.

> Primarily in bash2 and in VIM, I would like the delete key to remove the
> character where the prompt is or the next one to the right if at the
> beginning of a line.  Currently, DEL acts the same as BACKSPACE by deleting
> to the left of prompt if in editing mode in VIM or command line of bash, or
> moving to the left if not in an editing mode.  DEL, of my dreams, would
> move to the right if in a non-editing mode, as in VIM or other
> applications.

> Would someone please suggest a cure for this?  Thanks,      /ts

Maybe you want the following in your profile for vi command line editing:

set -o vi

You have to hit Esc before using the <- -> cursor keys, but then you can
'i' or 'a', and delete works like delete.

--
David Efflandt - All spam is ignored - http://www.de-srv.com/
http://www.autox.chicago.il.us/  http://www.berniesfloral.net/
http://cgi-help.virtualave.net/  http://hammer.prohosting.com/~cgi-wiz/

 
 
 

Backspace key becomes ^H in mail, man, etc; DEL key becomes ^[[3

Post by Kevi » Thu, 01 Nov 2001 05:31:44


    Having erase do the same thing locally on Linux as it does
    remotely on Solaris (from the local Linux) and visa versa is
    truely a painful exercise.  I got it to work and then I
    upgraded from Mandrake 7.0 to 8.0 and it's all wrong again.

    Sigh...



Quote:> That has always been the standard for the linux console and this standard
> has been copied from good old DEC vt100 terminals.  This standard is nice
> for emacs users which now has ctrl-H available for other purposes.

> So if TERM is set to linux or vtxxx set stty erase '^?'; otherwise set
> stty erase '^H'.  This should cover most of the cases.

--
Unless otherwise noted, the statements herein reflect my personal
opinions and not those of any organization with which I may be affiliated.
 
 
 

1. backspace become delete key

hi,

    I have upgraded Xfree86 from 3.2 to 3.3.2, everything is fine except
in all text boxes of Netscape as well as other Tcl/Tk programs, the
backspace key become the same as delete key. This is a small problem but
really confusing: i have to go back and delete if i found something was
wrongly typed(and i've gone beyond that). Is there any way that i can
change that?

thanks
Benny

2. Support for automatic shutdown/restart using APC UPS

3. - becomes /, * becomes (, etc

4. XILINX IDE GUI works on S9 fails on Solaris 10

5. Konsole and <ins> <del> keys

6. Problems using IPSec Manual with Sunscreen 3.2...

7. Why "key" has become "__key" in struct ipc_perm?

8. Problems with gcc 2.7.0...

9. Can't get [Backspace] key to register ASCII DEL

10. BACKSPACE & DEL keys on remte systems

11. Need help switching DEL & BACKSPACE keys

12. Backspace acts like "Del" key

13. Netscape -- backspace/del keys not working