简体   繁体   English

如何在iTerm2 Vim上退出备用屏幕滚动?

[英]How to exit alternate screen scrolling on iTerm2 Vim?

First, sorry if the title isn't precise. 首先,对不起,如果标题不准确。 I'm in a weird situation, while using Vim on Mac iTerm2. 在Mac iTerm2上使用Vim时,我处于一种奇怪的情况。 More precisely, when I release two finger click it scrolls down 3 lines. 更准确地说,当我松开两根手指时,它会向下滚动3行。

Sort of same thing is mentioned at https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=683942 and its referred as "alternate screen scrolling". https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=683942中提到了类似的内容,并且将其称为“备用屏幕滚动”。

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. 好吧,我在一个远程ssh会话中,只是关闭了Macbook,将其放在书包中,然后去吃了午餐。 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 . 在iTerm2如何关闭“滚动历史记录”中似乎提到了相同的问题。

It only happens on iTerm2, not on Terminal. 它仅在iTerm2上发生,而不在终端上发生。

So how do I go out of alternate screen? 那么,如何退出备用屏幕?

Type 类型

tput rmcup

(which assumes that vim used the terminal description to switch to the alternate screen), or (假设vim使用终端说明切换到备用屏幕),或

printf '\033[?1049l'

which makes fewer assumptions. 这使得较少的假设。

Further reading: Why doesn't the screen clear when running vi? 进一步阅读: 运行vi时为什么屏幕不清晰?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM