Can't backspace password (e.g. su and ssh password) on Xterm
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Can't backspace password (e.g. su and ssh password) on Xterm
Hi guys,
I have a problem with inserting passwords in Xterm. I used to use KDE and Konsole, and never had any problems; recently, I switched to Fluxbox and xterm, and since then I haven't been able to use the backspace key when typing passwords, that is, when I try, I always get a wrong password error, as if it didn't delete the previous characters but add new ones. My idea is that the password-reading program is not able to decode the characters representing backspace, but I really don't know how these things work.
I thought it could be a problem related to Termcap, since on Xterm I use the "xterm-256color" terminal and on Konsole I probably used something else, but I made some tests and I think that's not the issue: in fact, using any terminals (i.e. "linux", "xterm-256color" and "xterm"), when I use Xterm I experience this problem, whereas when I switch to a non-X console (by pressing Ctrl-Alt-F2, for example), using the same terminals, it works correctly.
So, it seems to be something related to Xterm. Also, this only happens when typing passwords; otherwise, the backspace key works fine.
"stty -a" showed that erase code is ^?, but on Xterm backspace sends ^H (on the regular Linux console it correctly sends ^?). If I use "stty erase ^H", then everything works, and I'm able to use backspace when typing passwords.
What I don't understand is why backspace normally works on Xterm then, if the character it sends is ^H.
Apart from this, how can I make the change permanent? I'm now editing .bashrc so that if $TERM is "xterm" then it calls "stty erase ^H", but is there a cleaner way?
Salve,
Since I never had that problem, I've never looked for a solution. If you do a search for that problem I'm sure there are solutions out there. That's how I found the solution I posted here.
Buona Domenica,
jdk
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.