Why is VIM starting in replace mode?
Solution 1
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
Solution 2
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.
Related videos on Youtube
Michael
Updated on September 18, 2022Comments
-
Michael over 1 year
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…-
mtak over 6 yearsNot sure if this'll help, but it doesn't do that for me on a fresh CentOS 7.3 installation.
-
Michael over 6 yearsThanks @mtak, that encouraged me to dig a little deeper.
-
-
jevon over 5 yearsStrangely 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.
-
jdgregson over 4 yearsI 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.
-
TripeHound over 4 yearsI 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...!). -
David Woods almost 4 years
set ambw=double
appears to have conflict with airline/powerline characters. I see extra spaces after the <| arrows.set t_u7=
works though! -
Bill Hoag over 3 yearsI'm using Windows Terminal 1.2.2381 with Ubuntu 20.04.1 in WSL 1. This problem seemed to start spontaneously recently - perhaps something auto updated recently. Anyway, this fix resolved the problem.