I just started using tmux, and I really like it, but I need to be able to scroll within the buffers/panes/windows I have open. I don't care if it works with the mouse or not. When I search the tmux man page, I find only two instances of the word "scroll" even showing up, and both have to do with copy mode. Is there a way to scroll without all the overhead of entering copy mode?
Ctrl-b then [ then you can use your normal navigation keys to scroll around (eg. Up Arrow or PgDn). Press q to quit scroll mode.
Alternatively you can press Ctrl-b PgUp to go directly into copy mode and scroll one page up (which is what it sounds like you will want most of the time)
You can also scroll up/down line by line using Shift-k and Shift-j (if you're already in scroll mode).
From my .tmux.conf:
This enables native xterm scrolling.
Well, you should consider the proper way to set scrolling:
add in your
It worked for me in windows and panes. Now tmux is just perfect.
Practical tmux has more info on tmux.conf files.
This is the way I made it work, and the reasons why I think it is better than the default way.
To try it out, put all the code sections in
Step 1. Change the prefix key so you won't have to reach one bit. 'B' is seemingly a close key, but it is in the middle of the two index fingers (at 'F' and 'J', respectively). Because that shortcut is essential in tmux, C-j is much better as it involves zero hand movement (apart from hitting the key).
Step 2. 'S' (to enter copy-mode) is: 1) close (same reason as above), 2) involves the other hand (compare: the 1-2 in boxing, or the
Step 3. The last part, the actual scrolling. 'P' and 'N' are familiar for this purpose to the Emacs users. They are close, intuitive ('P' is above 'N' on the keyboard), and mnemonic ("previous" and "next"). If you just did some scrolling in Emacs, and then go to tmux, it makes sense to have those shortcuts.
However, I found that 'I' and 'K' are even better - they are even closer than 'P' and 'N', and intuitive (for the same reason); as for mnemonics - as scrolling is such a common thing to do, mnemonics won't really matter as the shortcuts will soon bypass your brain and enter the muscle memory.