File contents remains in terminal after exiting Vim?
Try adding:

if &amp;term =~ "xterm"
    let &amp;t_ti = "\&lt;Esc&gt;[?47h"
    let &amp;t_te = "\&lt;Esc&gt;[?47l"
endif


to your ~/.vimrc

Ref: https://forums.vandyke.com/showthread.php?t=3431