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