In Terminal I cannot type lowercase e

Solution 1:

Let's debug it.

  1. Change shells and try again. (Credit to @Kent) In terminal:
    • $(which zsh)
  2. Comment out all lines in .bash_profile, .bashrc, etc. and open a new terminal tab/window. If this resolves the issue, something being loaded into the shell environment is consuming the letter e for reasons that science may never be able to explain.
  3. Try cating a file that contains the letter e to see if it will even display: (Credit to @techraf)
    • Open a text editor (not terminal)
    • Enter some text with a few es and save file (foo.txt?)
    • In terminal, cat the file:
      • cd /path/to/folder; cat foo.txt
    • If es render then the terminal can handle it, if not, then this is super weird.
  4. Try applescript. (Credit to @ALX)

    • Open Applescript editor
    • Create Applescript file with these contents:

      delay 10
      tell application "System Events" to keystroke "e"
      
    • Execute the script file and then quickly navigate to the terminal window. In a few seconds it will virtually press the e key and hopefully show up in your terminal. This would indicate that there could be an input/device driver issue (though I am clueless as to what that might be)

I'm not going to lie, I am absolutely fascinated by this issue and cannot wait to learn what the cause is. It's not hardware because it works in other applications, which means it's software and I cannot imagine who would swallow the letter e with code.

Solution 2:

I just found this thread after running into the same issue.

.inputrc

I had 2 lines in .inputrc, added in a moment of careless ignorance, beginning with e and s (which are valid bash config, but not valid readline config). They seem to have been interpreted as keybinding-aliases for readline customization.

Removing the lines from .inputrc, I have confirmed, solved my problem.

Thanks @user208052 for the relevant reminder to check .inputrc.

The shell's Readline configuration

The shell's bind command allows viewing and modification of Readline config. (See help bind. help is man for shell-internal commands).

View bind -p (maybe pipe to less |less or redirect to a file > binds.txt). It "list[s] functions and bindings in a form that can be reused as input".

It has entries like "c": self-insert for every character in the ASCII range, so the screwed up config may replace self-insert with some other Readline function.

It's got some gems; viewing it just taught me that C-= (\e=) prints possible completions, in my default configuration. It seems to show the complete current configuration of Readline for your shell...pretty useful and powerful. Good for exploring.

End to end test

  1. e works
  2. insert erroneous line in .inputrc, open new shell

    et completion-map-case on
    set completion-ignore-case on
    
  3. e is apparently a no-op

  4. bind -p (| grep -i '"E"') shows
    • "E": self-insert,
    • but no "e": self-insert
    • whereas "A": self-insert and "a": self-insert are present.