Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Up arrow produces

^[[A 

and down arrow produces

^[[B

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 at 10:03
    
username:x:1001:1001::/home/username:/bin/sh –  Michael Markieta Jan 15 at 10:09

1 Answer 1

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 at 10:25
1  
I added a bit of explanation to the answer –  steeldriver Jan 15 at 13:46
1  
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. –  neon_overload Jan 15 at 14:10

Your Answer

 
discard

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.