Bug 91357 - bashrc breaks stty erase
bashrc breaks stty erase
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: setup (Show other bugs)
9
All Linux
medium Severity medium
: ---
: ---
Assigned To: Bill Nottingham
Brock Organ
:
Depends On: 98752
Blocks:
  Show dependency treegraph
 
Reported: 2003-05-21 16:33 EDT by Marc MERLIN
Modified: 2014-03-16 22:36 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2003-12-08 14:32:31 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Marc MERLIN 2003-05-21 16:33:01 EDT
# I'm seeing this wrongly reset stty erase to ^H when it was ^? and the terminal
# was sending ^? too. Disabling this fixes the problem -- merlin
#    if [ -x /usr/bin/tput ]; then
#      if [ "x`tput kbs`" != "x" ]; then # We can't do this with "dumb" terminal
#        stty erase `tput kbs`
#      elif [ -x /usr/bin/wc ]; then
#        if [ "`tput kbs|wc -c `" -gt 0 ]; then # We can't do this with "dumb"
terminal
#          stty erase `tput kbs`
#        fi
#      fi
#    fi

This code would break erase inside screen for some users, or for me when I
logged in remotely.
tput kbs returned ^H when in all cases backspace generated ^?

I'm really not sure what cases the code is supposed to help with, but backspace
mapped to ^H is a thing of the past, you should concentrate on making sure that
all apps generate ^?, and leave things alone.
(it pains me when users ask me why backspace is _still_ broken in linux when
we've had more than 10 years to fix it)

If I'm missing something, let me know

Thanks
Marc
Comment 1 Marc MERLIN 2003-06-03 18:52:21 EDT
I found that the problem is mostly because you have a nonstandard screenrc which
generates ^H instead of ^?, and you try to account for that.
IMO, this is the wrong way to do it, if that's the only reason you have the
above code.

You use this:
# This makes screen treat backspaces '^?' as
# deletes. There should be a fix in the code
# for the way termcap inheritance works,
# but I dont know where to put it, and this works.
bindkey -d -k kb stuff "\010"


Debian, and most other folks use that:
bindkey -k kb stuff "\177"

The second way is consistent and generates ^?.

Your way works for screen run on the local machine, but if I run screen on a
remote machine (not running RH), screen generates ^? (as it should), and your
bashrc code changes stty erase to ^H, causing backspace not to work.

Unless I missed something, I don't see why you're trying to support BS set to ^H
when it's been abandonned in all of linux years ago.
Comment 2 Lon Hohberger 2003-06-06 09:15:39 EDT
As it turns out, neither are correct.

Distributions, in general, should not change the default backspace key binding
in /etc/screenrc.  Additionally, Screen ships with the backspace key defined as
'^H' in its termcap and terminfo settings; Debian modifies these to '^?'.  I am
not sure if this might also be causing problems for you (and others) or not.

I'll look into fixing screen as it ships with Red Hat Linux, but I consider it
unlikely that this will fix compatibility problems with other distributions
which ship with broken default settings.

Comment 3 Lon Hohberger 2003-07-02 10:54:32 EDT
Packages which do not have the 'bindkey' entry in /etc/screenrc are (or will be)
in rawhide shortly, and are also available from the URLs below.

http://people.redhat.com/lhh/screen-3.9.15-9.i386.rpm
http://people.redhat.com/lhh/screen-3.9.15-9.src.rpm

The above packages will *not* fix inter-operating system conflicts caused by
modified terminfo/termcap entries.
Comment 4 Lon Hohberger 2003-07-10 16:00:40 EDT
Unfortunately, I still have reports that removing this bindkey line breaks some
configurations, (though I have been unable to reproduce it myself).  Thus, I
will re-break screen for the time-being, and work on this after my vacation.
Comment 5 Micha Wiedenmann 2003-09-28 11:12:25 EDT
You meight want to read http://www.ibb.net/~anne/keyboard.html

The Debian Policy states that BS must send ^?, that is why ther terminfo entry
is changed.

If BS sends ^H, then C-h (as used eg. by Emacs) is not distinguishable from BS
and it is difficult to explain users, why BS generates help, etc.

 
Comment 6 Marc MERLIN 2003-10-24 02:49:00 EDT
I just don't understand why you are going through all that trouble to deal with
the fact that screen ships with a broken default of setting BS to ^H

Everyone else fixes this by doing the following:
in /etc/screenrc: bindkey -k kb stuff "\177"
in /etc/bashrc: don't muck with tput, just leave stty erase to ^?

The current RH config (BS=^H in screen but ^? everywhere else) is not only
complex, makes no sense to me, and doesn't work with escreen on a RH 9 machine
to another RH 9 machine.
Doing the above does fix the problem, and that's what other distros do AFAIK
Comment 7 Lon Hohberger 2003-10-29 10:47:51 EST
There is light at the end of the tunnel on this 3-year-old issue; screen-4.0.1.
I've packaged it up and placed it on my web page.  You can point 'yum' at:

http://people.redhat.com/lhh/fedora/

or just download the packages directly:

http://people.redhat.com/lhh/fedora/screen-4.0.1-0.1.i386.rpm
http://people.redhat.com/lhh/fedora/screen-4.0.1-0.1.src.rpm

Once you install this package, you need to comment out the 'stty erase `tput
kbs`' from /etc/bashrc and /etc/zshrc.  Screen should work as it did previously
on Red Hat Linux, Red Hat Enterprise Linux, and Fedora Core - except that the
backspace key is handled by the parent terminal's settings and inherited by
Screen (the way it's supposed to work).

NOTE: This is not an official package; I want to get it out there for testing. 
If it tests out well, I'll work with the shell maintainers to have the 'stty'
hack removed (if applicable) - which would then cause this bug to [finally] be
closed.
Comment 8 Lon Hohberger 2003-12-08 14:19:54 EST
New (Fedora) package - screen-4.0.1-2.i386.rpm will appear in rawhide
soon.  This package does *not* have a bindkey default, as per the
screen maintainer's recommendation.  For now, you can retrieve the
proper RPMs using yum from my repository:

http://people.redhat.com/lhh/fedora/

Or directly:

http://people.redhat.com/lhh/fedora/screen-4.0.1-2.i386.rpm
http://people.redhat.com/lhh/fedora/screen-4.0.1-2.src.rpm

** Note: You will need to comment out the block which executes "stty
`tput kbs`" in /etc/bashrc if you are using setup <= 2.5.27-1.1

Changing component to "setup" (which owns /etc/bashrc)
Comment 9 Bill Nottingham 2003-12-08 14:32:31 EST
Added in 2.5.28-1, will be in rawhide tomorrow.
Comment 10 Bill Nottingham 2003-12-08 14:33:00 EST
Erm, 2.5.30.

Note You need to log in before you can comment on or make changes to this bug.