Why is VIM starting in replace mode?

9

On several new CentOS 7 machines, I find that VIM automatically starts in replace mode.

After removing all automatically installed .vimrc files, normal behavior returns. However, if I simply create a .vimrc (eg. touch ~/.vimrc), VIM will begin starting with replace mode enabled by default…

Michael

Posted 2018-01-11T14:55:03.660

Reputation: 191

Not sure if this'll help, but it doesn't do that for me on a fresh CentOS 7.3 installation. – mtak – 2018-01-11T14:58:54.467

1Thanks @mtak, that encouraged me to dig a little deeper. – Michael – 2018-01-11T15:14:21.597

Answers

10

I have just identified that the issue only occurs when connecting to the remote system using the native OpenSSH client released with Windows 10 1709 using the ConEmu terminal emulator. If I use the same client with native powershell or cmd there is no difficulty - appears to be an issue with ConEmu. Hopefully this helps someone else.

Michael

Posted 2018-01-11T14:55:03.660

Reputation: 191

Strangely enough I'm getting this behaviour on Windows 10 1709 using native cmd & /windows/system32/openssh/ssh client. I don't think I have ConEmu installed. – jevon – 2018-11-19T23:03:31.937

I am also seeing this when using the OpenSSH client available through Windows 10. I have ConEmu installed and see it there. But I also see it in standard PowerShell windows and the new Windows Terminal preview. It is unbelievably aggravating. – jdgregson – 2019-08-13T15:48:42.300

I was getting the same thing on Windows 10 1809 using the built-in SSH client to talk to a Synology NAS box running some flavour of Linux. Following the suggestion in John Bolding's answer to a similar question, setting TERM=screen-256color-s seems to have worked (so far...!).

– TripeHound – 2020-01-28T10:56:16.927

0

Seems to be an issue with utf-8 ambiguous characters and Windows cmd console. Flag t_u7 is set by default and so vim will request cursor position and get a bad reply from the ssh client.

Workaround: Adding set t_u7= or set ambw=double to your vimrc should fix the problem. set t_u7= will disable requesting cursor position and ambw=double will set the ambiguous characters mode to double.

For more info see vim reference manual: https://vimhelp.org/term.txt.html

Zoran Bikicki

Posted 2018-01-11T14:55:03.660

Reputation: 1