vim
works fine on the first invocation on a remote Windows host, but further use leads to my terminal getting messed up. :redraw!
and reset
do not help:
Using the same local terminal, vim
works fine on a Linux remote host.
The broken remote host is a Windows server running OpenSSH, whilst the local machine is a Windows desktop. I have tried several terminal emulators, including mintty, ConEmu, and PuTTY, all have the same problem. The remote shell is bash.
I have read and tried several answers on this and other sites, including but not limited to changing the PS1, shopt -s checkwinsize
, export PROMPT_COMMAND="resize &>/dev/null ; $PROMPT_COMMAND"
, stty sane
, setting TERM=xterm-256color
, vi -u NONE -U NONE
, :set wrap
/:set nowrap
, export set LINES=58
… Nothing worked so far.
Relevant info (of the remote host):
afarah@BackRowL06 MINGW64 ~
$ uname -a
MINGW64_NT-10.0-14393 BackRowL06 3.0.7-338.x86_64 2019-11-21 23:07 UTC x86_64 Msys
afarah@BackRowL06 MINGW64 ~
$ echo $SHELL
/c/program files/git/bin/bash.exe
afarah@BackRowL06 MINGW64 ~
$ cat ~/.profile
afarah@BackRowL06 MINGW64 ~
$
afarah@BackRowL06 MINGW64 ~
$ echo $TERM
xterm
afarah@BackRowL06 MINGW64 ~
$ vim --version | grep terminfo
-balloon_eval +folding +multi_byte +terminfo
afarah@BackRowL06 MINGW64 ~
$ stty -a
speed 38400 baud; rows 24; columns 80; line = 0;
intr = ^C; quit = ^; erase = ^?; kill = ^U; eof = ^D; eol = ;
eol2 = ; swtch = ^Z; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R;
werase = ^W; lnext = ^V; discard = ^O; min = 1; time = 0;
-parenb -parodd cs8 -hupcl -cstopb cread -clocal -crtscts
-ignbrk brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff
-iuclc -ixany -imaxbel iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo -echoe -echok -echonl -noflsh -tostop -echoctl -echoke
-flusho
afarah@BackRowL06 MINGW64 ~
$ cat ~/.vimrc
cat: /c/Users/afarah/.vimrc: No such file or directory
afarah@BackRowL06 MINGW64 ~
$ bash --version
GNU bash, version 4.4.23(1)-release (x86_64-pc-msys)
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
I am pretty sure it is a problem with my remote host, as I use the same terminals on this Windows machine to ssh
to my Linux server and vi
works fine, but I cannot figure out the issue. Here are the same info from my Linux server:
marius:~ uname -a
Linux marius 4.19.0-6-amd64 #1 SMP Debian 4.19.67-2+deb10u1 (2019-09-20) x86_64 GNU/Linux
marius:~ echo $SHELL
/usr/bin/zsh
marius:~ echo $TERM
xterm
marius:~ vim --version | grep terminfo
-balloon_eval +folding +multi_byte +terminfo
marius:~ stty -a
speed 38400 baud; rows 24; columns 80; line = 0;
intr = ^C; quit = ^; erase = ^?; kill = ^U; eof = ^D; eol = M-^?; eol2 = M-^?;
swtch = ; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W;
lnext = ^V; discard = ^O; min = 1; time = 0;
-parenb -parodd -cmspar cs8 -hupcl -cstopb cread -clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff
-iuclc ixany imaxbel iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt
echoctl echoke -flusho -extproc
I tried updating the remote host shell and vim (both come with git-bash, which I installed there), to no avail. The output above is from the already updated host, using the latest version from https://git-scm.com/. The gif is from a previous version of vim.