Bash: can’t type ‘e’ or I’ll get infinitely repeating ‘H’s

Posted on

Problem :

At my workplace, there are several independent networks I work with, all running various versions of RedHat Linux 4, 5, and 6.

On one of those networks, I can’t use bash (or, as I’m finding out, anything that uses the bash front-end like python, gdb, etc) because when I try to type this:

> exit

I instead get:


Until I hit control-C (for bash or gdb) or, in another terminal, do a killall python for python.

My primary working shell is tcsh, but I use bash for all my scripting. I also drop into the shell interactively sometimes to do simple loops and the like. Luckily, ‘exit’ is in my history so I can use the up arrow to get it back and exit.

Just to be clear: this only happens when I run these programs interactively. It does not matter if I started the shell:

> bash

> bash --login

> env bash --login

> env bash

This happens whether I remove my bash_profile and bashrc files or not. AFAIK, there’s nothing in the system’s profile that would cause this.

I am completely at a loss how to even go about finding this! I’d GREATLY appreciate any help anybody can offer!


Solution :

So, with the help of a suggestion from choroba, I figured it out.

In this environment, they have the idiotic policy of nearly forcing everybody to source all the same resource files in addition to their own configuration. One day, they changed something and broke half of our shells.

In the process of trying to fix this, I put print statements in the various profiles and resource files so that I could see which ones were even being run to track down why things were broken.

I didn’t realize that, unlike every other file ending in ‘rc’, the ‘.inputrc’ doesn’t get RUN, it gets PARSED. And it gets parsed strangely. So, I had this in the .inputrc:

echo "Hello..."

Which somehow got interpreted by the binding system (which apparently only bash, gdb, python, and maybe some other things I hadn’t yet used actually look at) as ‘when the user types e, print H infinitely’. Which is clearly what I meant.

I now have a functional bash, python, and gdb! Thank you!

a quick hack,

$ i () { printf "%x" 14;}


$ i () { printf \x65;}
$ l`i`ss
Missing filename ("less --help" for help)
$ `i`xit

another hack,

$ E^b^[l

This makes E lower.

This might help,

$ bind -m `i`macs

Leave a Reply

Your email address will not be published. Required fields are marked *