问题
When I open the files in my redhat server vim is displaying something like this when I move the mouse down/up or when I go to insert mode and edit Also the contents inside gets jumbled up.
I also observed that it happens only when I ssh to server using my expect script.
What's the reason for this?
回答1:
I believe it's caused by you resizing the terminal window after interact
. According to the Expect book, you can add the following code after spawn
:
trap {
set rows [stty rows]
set cols [stty columns]
stty rows $rows columns $cols < $spawn_out(slave,name)
} WINCH

来源:https://stackoverflow.com/questions/54055316/vim-not-behaving-properly-in-server