Recently I started using tmux inside my terminal on my Mac. However now whenever I'm in a tmux session and I scroll up or down using my mouse, it scrolls through my command history instead of scrolling through my terminal pane. How do I disable this feature and make mouse scrolling go back to the default behavior?
The reason for this is probably that your terminal sends Up and Down keys for the mouse wheel when applications are in "cursor positioning mode" but do not request the mouse themselves, which is the case for tmux with the mouse option off.
You can perhaps configure your terminal not to do this, but it is unlikely. However, most terminals allow you to hold Shift or Ctrl or some other modifier key to select or scroll anyway so you could try this.
You will find when running tmux that the terminal scrollback is not reliable because tmux has little control over it. The recommended way to copy text when using tmux is to turn on tmux's own mouse support (set -g mouse on) and use copy mode.
Run this command:
$ tput rmcup
What happened most likely is that you were, either locally or remotely, running a command (like
top) that uses the terminal's "alternate screen" mode. When this is active, many terminal programs helpfully remap the scrolling action on the mouse to arrow keys, because generally scrolling the local display is less than helpful. If this application terminated ungracefully, your terminal may still think it's in that mode.
This command resets this, and should re-enable your ability to scroll.
I'm guessing you're using iTerm?