Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have tmux installed. But I can not scroll up or down.
I.e. as soon as I tmux I get only a portion of the screen and can not scroll up.
crtl-b + Page Up does not work since I am in Mac and I can not figure out why these keys are messed up and don't properly work.
Also neither ctrl-b + [ works. It is really annoying and I am pretty sure it is the Mac (first time user and I am really starting to be annoyed.....)
How can I do scrolling in tmux (on Mac I guess should be part of the question)

UPDATE:
I will try to describe my problem more:
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?

share|improve this question
    
What I was surprised about, but what seems to work out-of-the-box, is scrolling with the middle mouse while using tmux within gnome-terminal. –  Anthon Feb 13 at 8:40
add comment

4 Answers

If you're using OS X's Terminal.app, it will capture Page up/down keypresses 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":

Terminal.app keyboard settings screenshot

share|improve this answer
    
+1 although I can not test it but it seems to be a winner answer.I remember trying CMD with arrows but I don't remember trying SHIFT. Also swap the bindings for "page down/page up" and "shift page down/shift page up what do you mean? I am not sure what to do. I really hope this works because my nerves are completely wrecked by these –  Jim Jul 4 '13 at 20:05
    
@Jim Take a look at the screenshot. If you open the settings on your computer, you'll see that your "page up/down" and "shift page up/down" keys have different actions than what I have (these are the bindings: which key does which action). If you switch them around, you can change what happens when you're holding shift or not holding shift. (If you're editing them, you can input \033 by pressing escape) –  mrb Jul 4 '13 at 20:11
    
I don't have my mac available to check this right now, but in your screenshot for shift page down it has a text i.e.scroll to next page in buffer. This is special text that does exactly what is says? I.e. defines some mapping? Also is there a good book about these in mac? Because I have been going crazy with the keyboard the past weeks –  Jim Jul 4 '13 at 20:16
    
@Jim I don't know any books; I'm just surrounded by people raised on Macs. As for the key settings, it'll make more sense once you're actually doing it. :) –  mrb Jul 4 '13 at 20:25
    
Ok. I will try this asap. Thank you for your answer. I feel positive that you have given my the solution to my problem!!!Will accept this as soon as I test this –  Jim Jul 4 '13 at 20:30
show 1 more comment

From https://wiki.archlinux.org/index.php/Tmux

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.

There's also bind-key, in ~/.tmux.conf

bind-key j page-up
bind-key ; page-down

would bind j and ; to previous and next.

share|improve this answer
    
Evan - thanks for the formatting fixes. –  Rob Bos Jul 2 '13 at 23:33
    
page-up and page-down are not valid tmux (v1.8) commands, so those last two commands give an error: Unknown command: page-(up|down) –  Alex Leach Nov 27 '13 at 11:13
add comment

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.

share|improve this answer
add comment

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 correct way of updating your ~/.tmux.conf is:

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 in tmux manual

After this you can pageup and down with j and ; in copy-mode

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.