Tmux – scroll up/down with shift + page up/down into a pane

keyboard shortcutsscrollingtmux

I would like to be able to scroll up/down into a given pane with the same keybinding that xterm does, i.e SHIFT + Page Up/Down.

For example, if the tmux window is divided into 2 vertical panes, I could scroll on one of the two with keyboard while the other one does not scroll.

Is it possible ?

Here's my tmux.conf :

set -g status off
set -g prefix C-o
unbind C-b
bind C-o send-prefix

# settings -------------------------------------------------------------

setw -g utf8 on
setw -g xterm-keys on
set -g default-terminal "screen-256color"

set-option -g set-titles on
set-option -g set-titles-string '[#S:#I #H] #W'

# auto-set window title
setw -g automatic-rename
setw -g aggressive-resize on

# vim keybinds
set-option -g status-keys vi
set-window-option -g mode-keys vi

# scroll inside the current pane
#bind-key k page-up
#bind-key l page-down

# mouse
set -g mode-mouse on
setw -g mouse-select-window on
setw -g mouse-select-pane on

# scrollback buffer n lines
set -g history-limit 100000

# fixes shift-pageup/shift-pagedown
set -g terminal-overrides 'xterm*:smcup@:rmcup@'
set -g visual-activity on

# faster key repetition
set -s escape-time 0

# activity alert
setw -g monitor-activity on
set -g visual-activity on

# alt+directions navigates through panes
bind-key -n M-left select-pane -L
bind-key -n M-right select-pane -R
bind-key -n M-up select-pane -U
bind-key -n M-down select-pane -D

Best Answer

To scroll up you can do:

bind -n S-Pageup copy-mode -u

The above doesn't appear to work on a Mac, so I tested with:

bind -n S-Up copy-mode -u

As far as I can tell, after pressing S-Up, you can continue to use S-Up or just page-up to keep scrolling up. You can use page-down to scroll down. These aren't exactly the key-bindings you were looking for, so I apologize. This should get you closer to your goal I hope.

EDIT:

I just tested with:

bind -n Pageup copy-mode -u

and this allows you to use just page-up and page-down.

Related Question