Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

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

Up arrow produces


and down arrow produces


These look like ASCI escape codes. I don't get this problem when I am working outside of the SSH session. Also, when I sudo su in the SSH session to a different user I do not have this issue. It seems I may have some problems with my Ubuntu user account?

share|improve this question
what is the user's login shell? you can check with getent passwd $USER – steeldriver Jan 15 '14 at 10:03
username:x:1001:1001::/home/username:/bin/sh – Michael Markieta Jan 15 '14 at 10:09
up vote 1 down vote accepted

You appear to be running the dash shell (/bin/sh is a symbolic link to dash in the standard Ubuntu install). The default dash shell does not include support for inline editing or command history, so the arrow keys are not bound to the familiar edit/history functions and just appear in the terminal as raw keycodes.

Try changing your Ubuntu user's login shell to bash

chsh -s /bin/bash

and then starting a new SSH session.

share|improve this answer
Thank you! Can you explain why this worked? – Michael Markieta Jan 15 '14 at 10:25
I added a bit of explanation to the answer – steeldriver Jan 15 '14 at 13:46
The chsh tools allows users to modify the login shell assigned to them in /etc/passwd. In Debian and Ubuntu, /bin/sh is now Dash, designed as the system shell but not very pretty for interactive use. The default shell for regular users is normally /bin/bash. As for how you ended up with /bin/sh as your shell I don't know. – thomasrutter Jan 15 '14 at 14:10

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.