How to exit alternate screen scrolling on iTerm2 Vim?

心已入冬 提交于 2019-12-11 15:19:13

问题


First, sorry if the title isn't precise. I'm in a weird situation, while using Vim on Mac iTerm2. More precisely, when I release two finger click it scrolls down 3 lines.

Sort of same thing is mentioned at https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=683942 and its referred as "alternate screen scrolling".

How do I came in this situation? Well, I was in a remote ssh session and just just closed macbook, put it on bag and went to lunch. When I came back I experienced this strange thing.

It seems the same issue is mentioned at How can I turn off "scrolling the history" in iTerm2.

It only happens on iTerm2, not on Terminal.

So how do I go out of alternate screen?


回答1:


Type

tput rmcup

(which assumes that vim used the terminal description to switch to the alternate screen), or

printf '\033[?1049l'

which makes fewer assumptions.

Further reading: Why doesn't the screen clear when running vi?



来源:https://stackoverflow.com/questions/51763387/how-to-exit-alternate-screen-scrolling-on-iterm2-vim

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!