Skip to content

Commit e502e37

Browse files
committed
pass-through support for @mighty-scroll-fallback-mode
fixes #6
1 parent 507110b commit e502e37

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ $ tmux source ~/.tmux.conf
6363
|`@mighty-scroll-by-line`|`'man less pager fzf'`|List|Space separated list of processes that will be scrolled by line.|
6464
|`@mighty-scroll-by-page`|`'irssi vi'`|List|Space separated list of processes that will be scrolled by page.|
6565
|`@mighty-scroll-pass-through`|`'vim nvim'`|List|Space separated list of processes that will receive mouse scroll events as is.|
66-
|`@mighty-scroll-fallback-mode`|`'history'`|`'history'`, `'by-line'`, `'by-page'`|Scroll mode when in alternate screen but the process didn't match `by-line` and `by-page` lists from above.|
66+
|`@mighty-scroll-fallback-mode`|`'history'`|`'history'`, `'by-line'`, `'by-page'`, `'pass-through'`|Scroll mode when in alternate screen but the process didn't match the lists from above.|
6767
|`@mighty-scroll-show-indicator`|`off`|`on`, `off`|If enabled, shows the position indicator in the top right with current position and the number of lines in the history.|
6868

6969
Scrolling modes:

tmux.conf

+10-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,12 @@ bind-key -T root WheelUpPane {
99
if-shell -t "{mouse}" "$PSCHECK #{pane_pid} $MIGHTY_SCROLL_BY_PAGE || ( [ '$MIGHTY_SCROLL_FALLBACK_MODE' = 'by-page' ] && #{?alternate_on,true,false} )" {
1010
send-keys -t "{mouse}" PageUp
1111
} {
12-
mighty_scroll_enter_copy_mode
13-
mighty_scroll_with_interval -X scroll-up
12+
if-shell -t "{mouse}" "[ '$MIGHTY_SCROLL_FALLBACK_MODE' = 'pass-through' ] && #{?alternate_on,true,false}" {
13+
send-keys -t "{mouse}" -M
14+
} {
15+
mighty_scroll_enter_copy_mode
16+
mighty_scroll_with_interval -X scroll-up
17+
}
1418
}
1519
}
1620
}
@@ -26,6 +30,10 @@ bind-key -T root WheelDownPane {
2630
} {
2731
if-shell -t "{mouse}" "$PSCHECK #{pane_pid} $MIGHTY_SCROLL_BY_PAGE || ( [ '$MIGHTY_SCROLL_FALLBACK_MODE' = 'by-page' ] && #{?alternate_on,true,false} )" {
2832
send-keys -t "{mouse}" PageDown
33+
} {
34+
if-shell -t "{mouse}" "[ '$MIGHTY_SCROLL_FALLBACK_MODE' = 'pass-through' ] && #{?alternate_on,true,false}" {
35+
send-keys -t "{mouse}" -M
36+
}
2937
}
3038
}
3139
}

0 commit comments

Comments
 (0)