Disable "scroll wheel sends arrow keys in alternative screen mode" for tmux, enable for tmux+vim
- iTerm2 version: 3.4.5beta3
- OS version: 10.14
- Attach ~/Library/Preferences/com.googlecode.iterm2.plist here (drag-drop from finder into this window)
My problem
The "scroll wheel sends arrow keys in alternative screen mode"
breaks wheel scrolling in tmux; instead of scrolling the iterm window, moving the wheel cycles through command history when in a tmux bash session. However, I rely on having the "scroll wheel sends arrow keys in alternative screen mode"
enabled for vim, in order to get both the scrolling and text selection UX that I prefer:
- Scrolling: I want to enable mouse wheel scrolling in vim, less, etc
- Text selection: I want to use the OS provided text selection/copying support, and not the vim native version
Is there a way to both disable "scroll wheel sends arrow keys in alternative screen mode"
for tmux, but enable the option for "nested" alternative screen mode apps, such as vim running inside of a tmux session?
More context (tldr; every other option combo I've tried so far has broken something)
I'm trying to make the UX around scrolling and text selection as similar as I can for non-tmux and tmux sessions, but so far I haven't had any luck. Here's some stuff I tried:
-
config one:
- add
-CC
to all tmux commands to enable full iterm/tmux integration -
outcome:
- seems cool, but I want to be able to control tmux using the traditional
ctrl-b <whatever>
two-step inputs
- seems cool, but I want to be able to control tmux using the traditional
- add
-
config two:
- enable
"save lines to scrollback when an app status bar is present"
- enable
"scroll wheel sends arrow keys in alternative screen mode"
-
outcome:
- scrolling the mouse in a tmux bash session unexpectedly cycles through bash command history, instead of scrolling the iterm window itself through the scrollback
- enable
-
config three:
- enable
"save lines to scrollback when an app status bar is present"
- disable
"scroll wheel sends arrow keys in alternative screen mode"
- native tmux mouse support enabled
-
outcome:
- wheel scrolling in tmux bash sessions now activates copy mode, which is exactly what I don't want
- enable
-
config four:
- enable
"save lines to scrollback when an app status bar is present"
- disable
"scroll wheel sends arrow keys in alternative screen mode"
- native vim mouse support enabled
-
outcome:
- wheel scrolling for tmux bash sessions now moves through the scrollback of the iterm window itself, as desired
- wheel scrolling in vim works fine, but turning on any vim mouse mode also seems to force the use of vim native text selection, which is unwanted; my standard workflow uses the OS provided text selection/copy support
- enable
So far everything I've tried for tmux config ends up breaking some facet of the non-tmux scrolling and text selection UX which I like and to which I've become accustomed.