Note: This issue was fixed by Microsoft in January 2019, and has been rolling out to beta Windows 10 releases.
There can exist incompatible terminal types between the local and remote computers on an SSH connection.
This was noticeable for example between an Windows Subsystem for Linux SSH session to a CentOS 6 or 7 server.
The issue arises when trying to scroll in a text editor on the remote computer such as
vim among others.
The text display would become all scrambled.
Since the Microsoft WSL January 2019 fix takes perhaps a year or more to reach end users, it is worthwhile to provide the community this workaround.
On the local SSH client PC, make the entries to the problem remote connection(s) as follows in the
~/.ssh/config file on your local PC.
This is inside the WSL session for those using WSL.
Host myhost RequestTTY yes RemoteCommand export TERM=linux && bash
- opens a pseudo-terminal on the remote server, like the
ssh -toption. If you have trouble, try
- this should normally have a
&& bashat the end of the command, assuming you want an interactive SSH session. Otherwise the remote server runs the command and immediately disconnects.