Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I often ssh to a server that has a Bash shell. Previously all the normal shortcuts worked i.e. up would be last command, ctrl+r would allow me to search the previous commands.

However I logged on today and these no longer work e.g. up now displays ^[A and ctrl+r displays ^R. How can I revert it back to how it was before?

share|improve this question
Are you sure the remote shell is bash and not sh? What is the output of ps aux | grep $$? – terdon Sep 30 '13 at 14:54
I get a -ksh and grep process – rwolst Oct 1 '13 at 18:45
I think this must have changed as before it was definitely -bash. – rwolst Oct 1 '13 at 18:46
up vote 2 down vote accepted

I'll post my comment as an answer. It sounds like the remote shell you are using is not bash. You can check by running ps -p $$. If that does not output bash you are running another shell.

To set your default shell to bash again, you can run this command:

chsh USER

Where USER is your username on the remote server.

share|improve this answer
Thanks for the help (y) – rwolst Oct 3 '13 at 16:57

Perhaps your emacs-mode is not set to on.

You can check with set -o if emacs is on.

If it's not on you can set it with set -o emacs.

Also check if vi is off. (and else set it to off with set +o vi).

share|improve this answer
Thanks for the response, this has worked for up, but ctrl + r still isn't working?! – rwolst Sep 30 '13 at 13:50
Mmm, haven't had that before. Could you do a bind -p | grep -i search to check if you have a keyboard binding for "\C-r": reverse-search-history? – Rik Sep 30 '13 at 14:00
If its not there you could do a restart (i deleted my keybinding and it returned afterwards). Or else you could do bind '"\C-r": reverse-search-history' but i don't know if it's another issue if this survives a restart. – Rik Sep 30 '13 at 14:12
Hi Rik, the shell had been changed to ksh. I now just have to type bash and everything is working again. Thanks for the help. – rwolst Oct 1 '13 at 18:48

Your Answer


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

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