When you run vim in Xshell to edit some files, the content leaves on the screen after you exit the editor.
Two ways to solve this problem:
1. set the environment variable: TERM
export TERM = xterm
in .bashrc for bash
or
setenv TERM = xterm
in .cshrc for csh
After setting, source the file to take effect.
2. add one line to set the term type in .vimrc
set term = xterm