16

After a few days of operation on my new ec2 build, the following happens:

  1. I log into SSH, everything is fine, I do my coding
  2. I return the next day, and log into SSH
  3. I cannot type a lower cased e anymore--I get the error ding when I type it
  4. I try to ssh from a different computer, same problem
  5. I reboot the server, same problem
  6. I open nano or vi and e works fine, just not in bash or sh
  7. I terminate the server, create a new one, install from scratch, a few days later it happens again

This is baffling! Where do I even start to troubleshoot?

My Local Machine Setup(s):

  • windows XP or 7
  • putty (latest) or cygwin/openssh

The EC2 setup

Output of stty -a while I can't type an e

sh-4.1$ stty -a
speed 38400 baud; rows 30; columns 95; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>;
swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V;
flush = ^O; min = 1; time = 0;
-parenb -parodd cs8 -hupcl -cstopb cread -clocal -crtscts -cdtrdsr
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff -iuclc -ixany
-imaxbel -iutf8
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

In case it helps someone else with a similar issue, I created a script (called sub) to convert upper-cased E to lower-cased, then echo the command back. Then I run it in backticks to get an e on the command line::

#!/bin/sh
echo ${@//E/e}

> `sub Emacs /Etc/profilE`

UPDATES

  1. This breaks for all users
  2. In bash only (csh works fine)
  3. In emacs edit mode only

I've created a chat room to discuss this issue and hone in the solution.

Kato
  • 263
  • 1
  • 7
  • 1
    post the output of `stty -a` on the ec2 server when it goes wonky – MikeyB Nov 29 '11 at 18:03
  • done; thanks for the suggestion (although I have no idea what to make of it ;) ) – Kato Nov 29 '11 at 19:56
  • 1
    Is there anything funny in /etc/profile, ~/.profile or ~/.bashrc ? Can you su to another user and try it? It seems either that or maybe your keyboard character map was changed - possibly during updates? – thinice Nov 29 '11 at 20:03
  • I did a `sudo su -` with no joy; I posted /etc/profile online for review: http://pastebin.com/s6A37Vxx – Kato Nov 29 '11 at 20:11
  • Also, please post your comments as answers; the question is how to troubleshoot and these are some great solutions ;) – Kato Nov 29 '11 at 20:12
  • @Kato "How to troubleshoot" is not a valid Question on [sf] so we've taken to it mean "How do I fix $PROBLEM". A minor detail, but covered in the [FAQ] and [ask]. – Chris S Nov 29 '11 at 20:16
  • I guess I disagree; the FAQ says it's not for "general computer troubleshooting"; it's a very specific problem that I'm trying to troubleshoot and with any luck, solve here for others; I already know nobody has the specific answer though (because Google doesn't ;) ) – Kato Nov 29 '11 at 20:23
  • 1
    If you run `reset` followed by `stty sane` does the problem go away? – voretaq7 Nov 29 '11 at 20:27
  • 1
    @voretaq7 - no, but I'm not exactly sure what it means to run those from a script (obviously I can't run them from the CLI since they contain `e` :( Is there anything needed in my script to say "this applies to my shell session"? – Kato Nov 29 '11 at 20:31
  • 3
    Also look in `~/.inputrc` and `/etc/inputrc` for broken readline keybindings. – Sergey Vlasov Nov 29 '11 at 20:44
  • @Kato: copy and paste `reset; stty sane` – user9517 Nov 29 '11 at 20:51
  • @lain - oh I so wish! copy/paste strips the `e` chars :( – Kato Nov 29 '11 at 20:54
  • @Sergey_Vlasov I've linked to all of the appropriate configs in the original post ;) – Kato Nov 29 '11 at 20:55
  • I've created [a chat room](http://chat.stackexchange.com/rooms/info/1879/discuss-se-question-about-e-in-ssh), if you would like to offer additional suggestions or have a quick conversation; thanks, in advance for all ideas! – Kato Nov 29 '11 at 21:06
  • Phew, that was a subtle one; many thanks to MikeyB, Zoredache, @voretaq7, and rovanju for all the troubleshooting help! – Kato Nov 29 '11 at 22:48

1 Answers1

21

You've mistakenly put:

export EDITOR=/usr/bin/emacs

into your /etc/inputrc. This will map the letter 'e' to nothing at all.

Remove that and you should be fine.

MikeyB
  • 38,725
  • 10
  • 102
  • 186