-----BEGIN PGP SIGNED MESSAGE-----
There's something I don't understand about command-line editing (when it is
possible and to what degree).
I have a command-driven C program that I run on both my Linux
boxand our mainframe (HPUX). In each case I'm running it in an xterm.
On myown box, if I start the program from the bash prompt in the
X-terminal I getthe following behavior: If I backspace to correct a
mistyped commandwithin the C program the line appears to be corrected
on-screen, but on pressingEnter I get a seg fault with "Illegal
control char. (ASCII 8) encountered".
If I start the C program in its own window ("xterm -exec
<C-program> &") I get much the same. In this case backspacing makes
"^H" appear on-screen, but on pressing Enter the program crashes as
On the HP system, by contrast, the C program behaves in a forgiving
manner (whether it is started straight from the bash prompt, or put
into its own xterm window as above): backspacing and retyping has the
I also get the desirable behavior on my own system if I run the
program from the basic bash prompt, outside of X-Windows.
So I'm wondering: What parameters control this behavior, and how do
I change them? Thanks very much for any help.
What's going on here is your xmodmap.std (probably
/usr/X11/lib/X11/etc/xmodmap.std) sets the backspace key to BackSpace
(= ^H = "ASCII 8") by default. Why I don't know. Try editing it,
commenting out the original keycode 22 entry and changing it to
Delete, so it looks like this:
!keycode 22 = BackSpace
keycode 22 = Delete
Or, if you don't want to mess with "system defaults," you can copy
that file to your home directory, edit it there, and change your
.xinitrc to load the new mode map. Then restart the X server. This
should fix your line editing problems as well as Emacs, lynx, ftp, and
so on, but it "breaks" Netscape (I *really* don't know why this is),
for which you'll actually have to type ctl-H to delete and back up.
| PGP fingerprint: D4 17 D6 86 CC 8E 52 66 22 EF 11 34 9D 46 33 35 |
| To get PGP (US/CDN), point to http://web.mit.edu/network/pgp.html |
-----BEGIN PGP SIGNATURE-----
-----END PGP SIGNATURE-----