I set up a git repository on my Ubuntu machine as a server, which is on a home network. Then I SSH to this repository on the same computer or from another home computer. Login is fine. However, when I type a partial file or directory name at the terminal, then press tab, the cursor moves toward right on the terminal, without bringing the full file or directory name up as it normally does.
After I exit from the SSH server, the tab key works normally.
Edit:
Also, the →, ←, ↑ and ↓ keys don't work. When I press any of this, I get these at the terminal:
$ ^[[A^[[D^[[C^[[A
What could be the reason?
Add:
$ env
MAIL=/var/mail/git
USER=git
SSH_CLIENT=10.0.0.250 42342 2222
J2SDKDIR=/usr/lib/jvm/java-8-oracle
J2REDIR=/usr/lib/jvm/java-8-oracle/jre
HOME=/home/git
SSH_TTY=/dev/pts/5
LOGNAME=git
TERM=xterm-256color
XDG_SESSION_ID=93
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/lib/jvm/java-8-oracle/bin:/usr/lib/jvm/java-8-oracle/db/bin:/usr/lib/jvm/java-8-oracle/jre/bin
DERBY_HOME=/usr/lib/jvm/java-8-oracle/db
XDG_RUNTIME_DIR=/run/user/1001
LANG=en_US.UTF-8
SHELL=/bin/sh
PWD=/home/git
JAVA_HOME=/usr/lib/jvm/java-8-oracle
SSH_CONNECTION=10.0.0.250 42342 10.0.0.250 2222
Your current shell is the problem. You're currently using
sh
as the default shell, as seen in the output of yourenv
command:SHELL=/bin/sh
To fix your issue, you need to change to another shell that supports those key inputs (such as
bash
, which I'll use as an example). To do this, you'll need to use thechsh
utility (change shell).Example:
This will update the default shell environment for your user (see more here about full usage). You'll need to logout/login or start a new session to load in to the new shell.
Alternatively, you can utilise another shell by locating its path and running from your current shell. As an example, here's me changing from
sh
tobash
:Hope this helps!
You might have to run chsh like
sudo chsh username -s /bin/bash