LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Can't backspace password (e.g. su and ssh password) on Xterm (https://www.linuxquestions.org/questions/linux-software-2/cant-backspace-password-e-g-su-and-ssh-password-on-xterm-4175459635/)

simopal6 04-26-2013 03:12 AM

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.

Does anybody have any idea about this?
Thank you!

jdkaye 04-26-2013 01:58 PM

This link may be of use to you even though it's a Mac site. http://hints.macworld.com/article.ph...40930002324870 Go down to the post entitled "There is another way".
jdk

simopal6 04-27-2013 05:24 AM

Thanks, that did it!

"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?

Thanks!

jdkaye 04-27-2013 09:21 AM

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

simopal6 04-28-2013 03:16 AM

Ok, grazie ;)


All times are GMT -5. The time now is 10:34 AM.