1832616 Members
3367 Online
110043 Solutions
New Discussion

Backspace giving ^?^?

 
Mike_21
Frequent Advisor

Backspace giving ^?^?

How can I get rid of the "^?^?" characters when using my backspace key? I am using /sbin/sh...

Thanks
8 REPLIES 8
James Beamish-White
Trusted Contributor

Re: Backspace giving ^?^?

Type "stty erase ^?", where the ^? is the backspace key.

You can add it to your profile too.

OR, you can check your terminal util and see what it is using for DEL or BACKSPACE, and change it to the right one.

James
GARDENOFEDEN> create light
Alex Glennie
Honored Contributor

Re: Backspace giving ^?^?

What's your enviroment ie do you see this on the system console, under Xwindows/CDE, via a dtterm,xterm other vt emultor ? Are you using a PC ?

what's the output from stty -a ->

erase ^H intr ^C kill ^U start ^Q stop ^S swtch ^@ susp ^Z

What behaviour are you after ...Backspace = Delete
?

ps Sorry 4 all the Qu's
Mike_21
Frequent Advisor

Re: Backspace giving ^?^?

stty -a

speed 9600 baud; line = 0;
rows = 28; columns = 80
min = 4; time = 0;
intr = ^C; quit = ^\; erase = ^H; kill = ^U
eof = ^D; eol = ^@; eol2 ; swtch
stop = ^S; start = ^Q; susp = ^Z; dsusp = ^Y
werase ; lnext
parenb -parodd cs7 -cstopb hupcl -cread -clocal -loblk -crts
-ignbrk brkint ignpar -parmrk -inpck istrip -inlcr -igncr icrnl -iuclc
ixon -ixany ixoff -imaxbel -rtsxoff -ctsxon -ienqak
isig icanon -iexten -xcase echo echoe echok -echonl -noflsh
-echoctl -echoprt -echoke -flusho -pendin
opost -olcuc onlcr -ocrnl -onocr -onlret -ofill -ofdel -tostop
Sanjay_6
Honored Contributor

Re: Backspace giving ^?^?

Hi Mike,

Try this

stty erase "^?"

^ --> Shift + 6
? ---> ?

you can also try

stty erase "^H"

If it works, set the stty throuh your .profile

Hope this helps.

Thanks
Bill McNAMARA_1
Honored Contributor

Re: Backspace giving ^?^?

export TERM=hp

stty erase [backspace]
will set it right as mentioned.

Bill
It works for me (tm)
Sridhar Bhaskarla
Honored Contributor

Re: Backspace giving ^?^?

Mike

set your erase character through stty

stty erase

You should get rid of the problem.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Santosh Nair_1
Honored Contributor

Re: Backspace giving ^?^?

Just a suggestion, but you might want to do this in your .profile, i.e.:

if [ "$TERM" = "" ]
then
eval ` /bin/tset -s -Q -m ':?hp' `
else
eval ` /bin/tset -s -Q `
fi

if [ "$TERM" = "hp" ]
then
stty erase ^?
fi

-Santosh
Life is what's happening while you're busy making other plans
Frank Slootweg
Honored Contributor

Re: Backspace giving ^?^?

Do you perhaps use the Delete key instead of the Backspace key? The Delete key gives the behaviour which you describe. Backspace is octal code 10, while Delete is octal code 177.