Ctrl + A doesn't work in Bash Terminal on OS X Lion

In bash windows using the Terminal.app on OS X Lion, I can no longer use ctrl + A as a shortcut for going to the start of the command line. Other ctrl characters like ctrl + E don't work any longer either.

Any ideas?


Solution 1:

^A and ^E are commands of bashs "emacs mode". Check your bash settings with

set -o

and verify that emacs is set to on. If your bash is in vi-mode (vi on) then you need to use the vi shortcuts to navigate within the row (ESC to leave insert mode, 0 to go to the beginning and $ to go to the end).

Solution 2:

If you want your setting to persist between sessions, add the following to your ~/.profile.

set -o vi
set -o emacs

Of course, you should only add one of those two, depending on your preferred editing mode.

Solution 3:

Check to see the keyboard settings of your current theme. Terminal > Preferences > Settings > Keyboard.

If you don't see what you want in there try making a new theme to see if it works