backspace in X vs backspace in console

backspace in X vs backspace in console

Post by Robert Berneck » Tue, 04 May 1999 04:00:00

I am having a strange problem with backspace in
X in SuSE5.3/kde. A shell command that reads text
from the console works differently when X is running
than it does when X is not running.

Specifically, the backspace (aka erase) key works properly
(by which I mean it moves the cursor 1 position to the left,
deleting the character at that position) when X is not running.

When I do startx, the same shell script now treats backspace
as follows:
  The cursor moves 2 to the right, displaying ^H.
Obviously, X is remapping the key in some oddball way.

a. Why would anyone want to change this behavior in the
    first place?
b. What's the "correct" method of changing the behavior of
    backspace to the non-X behavior? By correct, I mean:
    the approved way, that will work when I reinstall or upgrade X.

Thanks. Bob


1. "read XX" and backspace key in console vs in X solved

I asked some time ago why backspaces in "read XX" in shell script works
fine in
non-X mode (acting as character delete), but fails in XFree86.
I eventually figured out (from reading the "keyboard and console HOWTO")

that delete and backspace are set up wrong (in the HOWTO author's
and in my opinion...) in X. In spite of them working properly in non-X
environments, X appears to remap those characters silently. The fix I
was to place an
   stty erase ^H
in /etc/profile.local. I think you could also put in your own .bashrc or

,profile or /etc/profile, depending on your taste. My understanding is
that /etc/profile.local is the best place for this if you want;

 a. the change to apply to all users
 b. the change to stick when you upgrade linux, as an upgrade may
    overwrite /etc/profile, but is not supposed to touch

Someone please correct me if the above is wrong, and let me know
what The Right Way is, and Why.

This was in SuSE 5.3.

2. Recommend a good CDR/CDRW backup program?

3. backspace does delete not backspace

4. LILO, NT, and, um, DOS?!? Oops . . .

5. Can the BackSpace key send an ASCII Backspace (^H)?

6. how to remove it ??

7. how to set backspace as backspace, not delete?

8. 98, want to put linux on top

9. telnet to linux Backspace work; rsh xterm Backspace don't work

10. How to make backspace key be backspace?

11. Help needed with console keyboard bindings (The old backspace/delete problem)

12. Backspace in Console is a no go (or vt100)

13. Elvis and the backspace key on the console