0

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?

1

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.

  • holding shift or ctrl does not allow me to scroll the terminal window. I can't seem to scroll at all when in a tmux session. Do you know of a solution that will allow me to scroll? – Victor Cui Apr 12 at 18:20
  • Turn on tmux's mouse support (set -g mouse on) and use it. You will need a relatively recent tmux version probably. – Nicholas Marriott Apr 13 at 5:07
-1

Run this command:

$ tput rmcup

What happened most likely is that you were, either locally or remotely, running a command (like vim, or 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?

  • No I'm just using the default terminal app. Running that command did not fix my problem and it didn't give me any output. – Victor Cui Apr 10 at 20:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.