Corrupt display when editing remotely via ssh

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Corrupt display when editing remotely via ssh

Norm Wood

I'm having problems with garbling of the displayed text when ssh'ing
a remote machine to edit a file.  Here's a 'MWE' of the steps that
the problem.

1.  Open xterm on local_machine (Slackware 14.1), check environment:
     TERM is 'xterm'
     XTERM_VERSION is 'X.Org 7.6.0(297)

2.  Ssh to remote_machine (CentOS 6.9), and I'm in a pseudo terminal:
     $ ps -o 'cmd=' -pp $(ps -o 'ppid=' -p $$)
     returns (for example):
     sshd: me@pts/14

3.  Check the environment on remote_machine:
     TERM is 'xterm'

4.  Open a text file for editing:
     $ vim -N -u NONE myfile.txt

     The vim version on remote_machine is 7.4.629, and is compiled with
      +terminfo and ++builtin_terms.

5.  Check value of 'term in Vim:
     :set term
     and it shows 'term=xterm'

6.  Move around using e.g. Ctrl-f, Ctrl-b,  do some deletions and
     insertions, and text gets garbled (details below).

Interestingly, if I then explicitly set the terminal in Vim:
     :set term=xterm
the garbling goes away...

The "garbling" duplicates that reported by Lowell Specht in this thread:!searchin/vim_use/ssh$20redraw|sort:relevance/vim_use/vJZJMe4fFgE/brm6sh1aBgAJ

For example, moving around with Ctrl-f and Ctrl-b causes many lines to
be duplicated and not wrap correctly.  Resizing the window does the same
thing.  Eventually, any displayed line is a jumble of blocks of text
from other

When deleting characters from a line, trailing characters are left in
original positions.  For example, applying '4x' to 'rain' in 'The rain
in Spain stays
mainly in the plain.'   leaves 'The in Spain stays mainly in the
plain.ain.'.  Executing
':redraw' or ':redraw!' has no effect.  If I save the garbled file and
reopen it, I get a
proper-looking file.

Obviously, I have a fairly simple work-around (set the terminal
explicitly each
time I start Vim), but if anyone can suggest the cause and a solution, I
appreciate it.


You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit

You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit