I have no idea why, but on my EC2 instances which are running Ubuntu 10.04 the ALT key shortcuts are not working and instead question marks are showing instead.

E.g. ALT+f for moving forward a word doesn't work...

In case it matters:

$ echo $TERM
  • What terminal emulator are you using? If you press Ctrl-v then Alt-f, what do you see? What is output when you do Ctrl-x Ctrl-v? – Paused until further notice. Mar 14 '11 at 14:17
  • Ctrl-v Alt-f outputs nothing. Xtrl-x Ctrl-v outputs: GNU bash, version 4.1.5(1)-release (x86_64-pc-linux-gnu) – abyx Mar 14 '11 at 15:55

Turns out this is an iTerm/iTerm2 issue. For some reason the default for the option key behavior, which is to act as 'meta', worked well for me on any other SSH session, but on the EC2 servers it produced the noted behavior.

Once I realized this is an iTerm2 used it FAQ to solve this: Under Preferences->Profiles select the relevant profile, and switch to the 'Keyboard' tab. At the bottom set both option keys to send escape codes (act as +Esc). This solved my issue with no regressions on other SSH sessions.

Thanks Dennis & Jake!

| improve this answer | |

Sounds like keyboard layout... sudo dpkg-reconfigure console-setup is the command the link mentions.

| improve this answer | |
  • I tried it, simply entering the defaults which seem to me like they should work changed nothing (I work with the OP). – abyx Mar 14 '11 at 15:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.