1

I'm not sure if readline is what really missing but the problem is shell (instead of bash) and when I click the up and down arrow I get the following instead of command history:

$ ^[[A^[[A^[[A^[[A^[[A^[[A^[[A

What's missing?

migrated from serverfault.com Jul 9 '13 at 20:54

This question came from our site for system and network administrators.

  • 1
    What shell are you using? Type echo $0 to find out your shell. – unxnut Jul 9 '13 at 20:56
  • probably proper setting of the TERM variable and maybe shell environment variables. Check the man page for the specifics. – mdpc Jul 9 '13 at 20:57
  • @unxnut $ echo $0 -sh – Adam Silver Jul 9 '13 at 20:58
  • What's missing? The way you started that shell, for a start. Did you log in on the console? Start a terminal in X? Log in via SSH? Does that always happen with this account, or only for certain ways of starting a shell? Did it always happen, and if not what changed? – Gilles Jul 9 '13 at 21:02
  • 1
    I do not think sh supports command history. That is why the arrows are getting echoed to the screen. – unxnut Jul 9 '13 at 21:08
6

You are running sh, which in Debian links to dash. If that is not the shell you want, try typing in exec bash.

dash (well, neither dash nor the original Bourne sh) doesn't use readline, which explains why you see those escape sequences when you attempt to use the arrow keys.

0

Install the rlwrap util, and use it like so:

rlwrap dash

After which, pressing the will return the previous lines in the history, much like bash.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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