I have installed the new iTerm 2.
It asked me in a yellow bar at the top if I\'d like to enable a mouse feature. Unfortunately I don\'t remember the exact sentence anymore.
I was having this same problem and none of the solutions I read and tried worked. What fixed my problem was turning Secure Keyboard Entry off and now when I use the mouse to scroll it in ssh and in terminal mode on macOS 10.13 it works like I expect it too!