9

In iTerm2 (Version 2.1.4), when I scroll up to see previous commands, I'm seeing chunks of previous Vim sessions, which I don't want to see. Any idea why that would be happening and how to fix that?

As an example, here's some output after I typed a line of a file in Vim, then scrolled up. The top line is a remnant of the Vim session. (I have line numbers on in Vim, which is where the 1 comes from.)

  1 I'm typing a line in Vim.
Last login: Tue Jan  5 10:16:18 on ttys001
imac:~$ vi test.txt
imac:~$ cat test.txt
I'm typing a line in Vim.
imac:~$

Sometimes much larger remnants are displayed. Any thoughts would be appreciated.

3 Answers3

12

George Nachman, the iTerm2 guy, ended up solving my problem here. In short, I just needed to uncheck Prefs > Profiles > Terminal > Save lines to scrollback in alternate screen mode in the iTerm2 menu.

0

I’m running urxvt in XQuartz and had the same problem. What fixed it for me was to add the following to ~/.Xdefaults:

urxvt*secondaryScreen: 1
urxvt*secondaryScroll: 0

From the man pages:

secondaryScreen: boolean
Turn on/off secondary screen (default enabled).
secondaryScroll: boolean
Turn on/off secondary screen scroll (default enabled). If this option is enabled, scrolls on the secondary screen will change the scrollback buffer and, when secondaryScreen is off, switching to/from the secondary screen will instead scroll the screen up.

Jens
  • 103
0

For anybody who is having a problem getting Ben Lindsay's solution to work, make sure that the profile selected is the current one you are using; it's not always the case when you open your prferences - it's the one with the star next to it:

enter image description here

Toto
  • 19,304