How to exit alternate screen scrolling on iTerm2 V

2019-08-27 16:47发布

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条回答
手持菜刀,她持情操
2楼-- · 2019-08-27 17:40

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?

查看更多
登录 后发表回答