When The Shell Breaks Your Arrow Keys

Published on 2026-09-01 by Emma Juettner

A problem I ran into recently: I logged onto a new VM, started navigating around, and quickly realized that my arrow keys were not working. They were outputting things like ^[[A^[[C^[[D^[[B instead of actually navigating the way I would expect when using bash.

If you have seen this issue before, you may recognize this as a sign that my shell was not, in fact, set to bash. So I ran echo $SHELL to identify my current shell. It was /bin/sh, which upon further examination (ls -la /bin/sh) linked to dash, which doesn't support command line history or advanced editing.

So, I needed to set my login shell to bash. Luckily, that's easy enough:

chsh -s /bin/bash my_username

After running that and starting a new session, echo $SHELL evaluated to /bin/bash, and my arrow keys were working again.

Hopefully this post will help someone who runs into this same issue in the future-- even if that person is just me!