Question

I recently rebuilt my system and everything works except I can't scroll my (iterm2) terminal window back to look at commands and output that have scrolled off the screen.

Without tmux I can scroll but with tmux I can't

When using vim this isn't an issue as I can scroll back within vim.

For basic terminal (which I don't normally use) the behavior is a little different in that the current line scrolls back to show previous commands, but just that line, not the whole window.

My terminal settings include: enter image description here

I do use tmux and I have a detailed .tmux.conf However I have removed these settings, applied with tmux source-file ~/.tmux.conf,. seen the changes applied (back to default tmux setting) and still have the issue

My settings include

set -g mouse on
Was it helpful?

Solution

The recent release of tmux 2.1 changed some of the configuration options. This bit of code (taken from here) restores the previous functionality:

bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'select-pane -t=; copy-mode -e; send-keys -M'"  
bind -n WheelDownPane select-pane -t= \; send-keys -M 

Add/place these in the ~/.tmux.conf file

Apply with tmux source-file ~/.tmux.conf

OTHER TIPS

In iTerm2 all you need to do is to go to Preferences > Profile > Terminal and check ‘Save lines to scrollback when an app status bar is present’.

One cause of this is the "Secure Keyboard Entry" feature of iTerm.

To solve this problem, you can go with iTerms -> Secure Keyboard Entry, and de-select that item.

enter image description here

I came across this issue with my Logitech MX Master 2S as well, and unfortunately other solutions mentioned here didn't work to me.

Licensed under: CC-BY-SA with attribution
Not affiliated with apple.stackexchange
scroll top