Unix & Linux: How can I page up or down in tmux with Terminal.app? (7 Solutions!!)

preview_player
Показать описание


The Question: When I am in tmux only a portion of the text shows up. If I try to scroll up or
down the console scrolls up but not the actual text. If I do CTRL+b followed by
[, I see in the status bar *tmux, and If I press the up or down arrow I can
actually go up/down on the text line by line. When I press q I see in the
status line bash.
When I do CTRL+b follow Page UP or Page the console goes up or down but not the
text.
How can I scroll up or down the text in more than one line at a time?

Solutions: Please watch the whole video to see all solutions, in order of how many people found them helpful

If you are new to OS X and are familiar with Windows and Linux keyboard
shortcuts, you will probably be in the habit of using the CTRL for many things.
In OS X the Command (aka Apple) Key is often used in place of the CTRL key.
Also, instead of the Page keys, try using Command + Up (or the other
directional keys) to move your cursor or screen.

== This solution helped 3 people ==
If you have issues scrolling with Shift-PageUp/Shift-PageDown in your
terminal, try this:
set -g terminal-overrides 'xterm*:smcup@:rmcup@'
It could also be a terminal emulation thing, try one of the following.
export TERM=vt100
export TERM=ansi
export TERM=xterm
maybe one of those would do it.
bind-key j page-up
bind-key ; page-down
would bind j and ; to previous and next.

== This solution helped 92 people ==
and just scroll the window contents, as if you used the scroll bar. You can use
Shift+Page up/down to send them to the application inside the terminal.
Using that, you should be able to scroll by a page at a time using:
1. Control+B
2. [
3. Arrows keys or Shift+Page up/down
4. Control+C when done with scrollback
If you want to change this to behave like every other terminal app on every
other platform, you can go to Terminal -> Preferences, Settings, choose your
profile and go to Keyboard, and swap the bindings for "page down/page up" and
"shift page down/shift page up":

== This solution helped 7 people ==
An update of binding commands in Rob's answer, and in response to Alex's
comments:
I also found page-up and page-down are not valid tmux (v1.8) commands, a
bind-key -t (emacs|vi)-copy j page-up
bind-key -t (emacs|vi)-copy ; page-down
Pick either emacs or vi depending on what style tmux uses, refer to mode-keys
After this you can pageup and down with j and ; in copy-mode

== This solution helped 1 person ==
Check to make sure you are using the proper tmux key bindings (vi vs emacs) by
copy-mode
I had a similar issue where I could move the cursor with arrow keys but
couldn't page up or down using Control+U/D and couldn't select and copy using
Space and Enter. Turns out, tmux was on emacs mode on my Mac and vi mode in
Linux even though I never explicitly set it for either OS.

== This solution helped 32 people ==
I use the default combination on pre Yosemite MacBook Pro: fn+?+? or fn+?+?.
EDIT: I've found on a MBP running Yosemite fn+? or fn+? should works by
default.
In documentation it is often shown as ? or ?

Рекомендации по теме
join shbcf.ru