stty sane and xterm

Bruce Dubbs bruce.dubbs at
Sat Jan 19 23:47:17 PST 2008

DJ Lucas wrote:
> This is a silly little issue that has bugged me for a while now, but it
> disappears when I finally install gnome's term, so I've never bothered
> to mess with it.  Anyway, 'stty sane' breaks the backspace character in
> recent xterm.  I'm not sure if this is related to utf8 or not, can
> anybody verify?  Anyway, the 'fix' (xterm -ie) is fairly easy for the
> default xinitrc ($XORG_PREFIX/lib/xinit/xinitrc) and I wondered if this
> should be added to the book in the configuring xorg page?  Better solution?

I've never noticed this because I use konsole all the time, but stty
sane does indeed break the backspace key for me too.

>From the man page, sane is a shortcut for

cread -ignbrk brkint -inlcr -igncr icrnl -iutf8 -ixoff -iuclc -ixany
imaxbel opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel  nl0  cr0
tab0 bs0 vt0 ff0 isig icanon iexten echo echoe echok -echonl -noflsh
-xcase -tostop -echoprt echoctl echoke


"all special characters to their default values".

What it does is set erase to ^? (Hex 7F) from ^H (hex 08).

You can fix by

  `stty erase <press backspace key>`

No other characters change.   Use `stty -a` to see all the settings.

The only other parameters that I see change are brkint are imaxbel

       breaks cause an interrupt signal

* [-]imaxbel
       beep and do not flush a full input buffer on a character

  -- Bruce

More information about the blfs-dev mailing list