Search code examples
scrolltmux

how to scroll to beginning/end of scroll buffer in tmux?


^b+page up/down scrolls up/down one page of scroll buffer, but how do we scroll to beginning ?

like wise with end (besides pressing ^C to kill scrolling)


Solution

  • This depends on the binding of "mode-keys". If you have set-option -g mode-keys emacs in your ~/.tmux.conf file (actually, this should be the default), then you can go to the beginning and the end of the buffer using corresponding emacs keys:

    1. Enter the copy mode using: ctrl-b + [
    2. Go to the beginning using: Alt + shift + , (or, in emacs' notation: M-<)

    Similarly, going to the end is achieved by M->

    If instead you prefer vi keybindings, you can put set-option -g mode-keys vi in your ~/.tmux.conf file, and then you have:

    1. Enter the copy mode using: ctrl-b + [
    2. Go to the beginning using gg, go to the bottom using G

    Please note that configuration in ~/.tmux.conf only takes effect after the tmux server restarts. That is when you kill all sessions and then restart tmux.