1753842 Members
8300 Online
108806 Solutions
New Discussion юеВ

Backspace key problem

 
SOLVED
Go to solution
B. Jen
Contributor

Backspace key problem

Hi, when I login, my backspace key works. After I "su root" and exit out from root, my backspace key is no longer working. Please help!

Thank you.
6 REPLIES 6
Mel Burslan
Honored Contributor

Re: Backspace key problem

before you su to root, while you are on root prompt and after you exit out of su root session, that is 3 times total, run this command and post the output please:

stty | grep erase
________________________________
UNIX because I majored in cryptology...
James R. Ferguson
Acclaimed Contributor
Solution

Re: Backspace key problem

Hi:

I'd start by comparing the output of:

# stty -a|grep erase

...before and after the 'su -' operation. If you are doing 'su -' then the login profile of the target account is run. This may have redefined the backspace (erase). Another was to test this is to compare an 'su' with an 'su -'.

Regards!

...JRF...
B. Jen
Contributor

Re: Backspace key problem

Output from stty | grep erase
Before su
intr = ^C; erase = ^H; kill = ^U; (backspace key works)
After su
intr = ^C; erase = DEL; kill = ^U; (backspace key works)
Exit from su
intr = ^C; erase = DEL; kill = ^U; (no longer working!)

Thank you for your help!
James R. Ferguson
Acclaimed Contributor

Re: Backspace key problem

Hi (again):

...and I meant to add: look in the 'profile' of the account that "disables" the behavior you seek (assuming that you 'su -' to it. It is quite likely that an 'stty erase=' has been performed therein.

Regards!

...JRF...
TwoProc
Honored Contributor

Re: Backspace key problem

I think this is because "stty" commands affect your terminal, not just your current shell.

Things may not work this way any longer, or it could be that we were on muxes but...
As possible proof I offer the following:

Waaaaay back when (right after electricity was created), I was an operator, and we often had users who had problems with their backspace. Well some, of them never quite "got it", and couldn't edit their .login or .cshrc to save their life, and if we did it for them, they would somehow mess it up (I'm talking about just a few of the users).

I had observed that I could fix it for them from the operator console if I just did an
$> "stty erase >
/dev/"
if their terminal was left open for writing, which was easist to allow via "biff y".

And it would fix their problem with this.

Meaning that, at least back then, it was their terminal that we affected by "stty" not just (or maybe not even) their shell.
We are the people our parents warned us about --Jimmy Buffett
Dennis Handly
Acclaimed Contributor

Re: Backspace key problem

>After su
erase = DEL; kill = ^U; (backspace key works)

When did the backspace key work, while you were logged into root? I can't see how since it set backspace to the delete key.

So you can either change root's .profile or you can manually reset it with "stty erase ..." as TwoProc said.