When I have a file open in either the standard Terminal or iTerm2, I've noticed a weird problem. When I use the Trackpad to scroll through the file with two fingers, if I scroll to the top of the file and scroll a bit more, it goes past that and goes back into my Terminal command history.

I'd really like this behavior to not happen, and stop at the top/bottom of the file. I've only observed this in macOS and not Linux.

Is there a setting I need to tweak?

1 Answer 1


I managed to eventually find the settings to stop this behavior.

In Terminal, it was Preferences -> Profiles -> Keyboard and check the box for "scroll alternate screen"

In iTerm2, it was Preferences -> Advanced -> set "Scroll wheel sends arrow keys when in alternate screen mode" to Yes.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .