Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Before I was able to use the Up/Down arrow keys to cycle through previous commands, but now when I press a directional key it outputs "^[[A". I'm running a bash shell. How do I fix this?

share|improve this question
Whats your terminal? –  echox Oct 23 '10 at 0:48
How would I find that information? –  please help Oct 23 '10 at 1:09
@please: I expect that you are using a terminal emulator which is what you might call a "shell window" on whatever system you are running. As this is almost certainly so, your probably have a Help -> About menu selection: what does that say? What operating system are you running your terminal on? (e.g. Windows, MacOS, Debian, etc.) –  msw Oct 23 '10 at 3:29
There are many possibilities: your terminal is misconfigured (unlikely), your shell has wrong ideas about your terminal (less unlikely), you're getting a shell other than bash, etc. To start diagnosing, describe your OS (distribution, version, …), how you start a shell window, and the output of echo $TERM; ps -p $$ -p $PPID in a shell window. –  Gilles Oct 23 '10 at 22:16
What do the commands echo $TERM and toe print? –  ephemient Oct 23 '10 at 22:20

1 Answer 1

Try typing

set -o emacs
share|improve this answer
That would be my advice, too. Seems like vi mode is enabled in the shell. –  mru Oct 24 '10 at 18:29
Doesn't work for me. –  Agi Hammerthief Mar 9 '14 at 12:02

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.