How do I scroll in tmux? Announcing the arrival of Valued Associate #679: Cesar Manara ...

How to compute a Jacobian using polar coordinates?

false 'Security alert' from Google - every login generates mails from 'no-reply@accounts.google.com'

When does Bran Stark remember Jamie pushing him?

What to do with someone that cheated their way though university and a PhD program?

Will I lose my paid in full property

Variable does not exist: sObjectType (Task.sObjectType)

Is it OK if I do not take the receipt in Germany?

How would you suggest I follow up with coworkers about our deadline that's today?

Retract an already submitted Recommendation Letter (written for an undergrad student)

Marquee sign letters

Why do people think Winterfell crypts is the safest place for women, children & old people?

Writing a T-SQL stored procedure to receive 4 numbers and insert them into a table

What were wait-states, and why was it only an issue for PCs?

Why did Europeans not widely domesticate foxes?

Preserving file and folder permissions with rsync

Philosophers who were composers?

What's parked in Mil Moscow helicopter plant?

Suing a Police Officer Instead of the Police Department

What is the evidence that custom checks in Northern Ireland are going to result in violence?

Coin Game with infinite paradox

What does the black goddess statue do and what is it?

What do you call an IPA symbol that lacks a name (e.g. ɲ)?

What is /etc/mtab in Linux?

How long can a nation maintain a technological edge over the rest of the world?



How do I scroll in tmux?



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30 pm US/Eastern)Scrolling in tmux over SSH (PuTTY)Scroll shell output with mouse in tmuxUse terminal scrollbar with tmuxBind keys for scrolling pages in copy mode in tmuxPass mouse events through tmuxScroll in tmux but don't enter copy mode?Can't scroll tmux context by more than one line at a timeScroll shell output with mouse in tmuxtmux deleting currently displayed content when pressing ^LWhat does the [0/0] indicator mean when entering copy mode in tmux?Scroll in tmux but don't enter copy mode?Is it possible to freely intersperse vim panes from the same session and other shell panes in tmux?optionally run several commands when starting tmuxtmux - scroll up/down with shift + page up/down into a panePass mouse events through tmuxMulti-page output :: text select with tmux over sshtmux mouse passthrough mode?





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







1195















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?










share|improve this question




















  • 7





    What overhead are you concerned with? copy-mode is the way to view history (and optionally copy stuff out of it).

    – Chris Johnsen
    Nov 11 '10 at 5:48






  • 1





    for me you can press f7 for scroll mode and q to quit

    – JohnMerlino
    Jul 25 '14 at 14:56






  • 6





    set -g mode-mouse on per @chaiyachaiya's answer was the winner for me

    – Peter Berg
    Jul 21 '16 at 19:36


















1195















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?










share|improve this question




















  • 7





    What overhead are you concerned with? copy-mode is the way to view history (and optionally copy stuff out of it).

    – Chris Johnsen
    Nov 11 '10 at 5:48






  • 1





    for me you can press f7 for scroll mode and q to quit

    – JohnMerlino
    Jul 25 '14 at 14:56






  • 6





    set -g mode-mouse on per @chaiyachaiya's answer was the winner for me

    – Peter Berg
    Jul 21 '16 at 19:36














1195












1195








1195


465






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?










share|improve this question
















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?







tmux






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Sep 27 '12 at 18:13









Flow

68511323




68511323










asked Nov 10 '10 at 18:40









chadohchadoh

6,1243118




6,1243118








  • 7





    What overhead are you concerned with? copy-mode is the way to view history (and optionally copy stuff out of it).

    – Chris Johnsen
    Nov 11 '10 at 5:48






  • 1





    for me you can press f7 for scroll mode and q to quit

    – JohnMerlino
    Jul 25 '14 at 14:56






  • 6





    set -g mode-mouse on per @chaiyachaiya's answer was the winner for me

    – Peter Berg
    Jul 21 '16 at 19:36














  • 7





    What overhead are you concerned with? copy-mode is the way to view history (and optionally copy stuff out of it).

    – Chris Johnsen
    Nov 11 '10 at 5:48






  • 1





    for me you can press f7 for scroll mode and q to quit

    – JohnMerlino
    Jul 25 '14 at 14:56






  • 6





    set -g mode-mouse on per @chaiyachaiya's answer was the winner for me

    – Peter Berg
    Jul 21 '16 at 19:36








7




7





What overhead are you concerned with? copy-mode is the way to view history (and optionally copy stuff out of it).

– Chris Johnsen
Nov 11 '10 at 5:48





What overhead are you concerned with? copy-mode is the way to view history (and optionally copy stuff out of it).

– Chris Johnsen
Nov 11 '10 at 5:48




1




1





for me you can press f7 for scroll mode and q to quit

– JohnMerlino
Jul 25 '14 at 14:56





for me you can press f7 for scroll mode and q to quit

– JohnMerlino
Jul 25 '14 at 14:56




6




6





set -g mode-mouse on per @chaiyachaiya's answer was the winner for me

– Peter Berg
Jul 21 '16 at 19:36





set -g mode-mouse on per @chaiyachaiya's answer was the winner for me

– Peter Berg
Jul 21 '16 at 19:36










12 Answers
12






active

oldest

votes


















1440














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)



In vi mode (see below), you can also scroll the page up/down line by line using Shift-k and Shift-j (if you're already in scroll mode). Unshifted, the cursor moves instead of the page.



Excerpts from the man page:




tmux may be controlled from an attached client by using a key combination of a prefix key, ‘C-b’ (Ctrl-b) by default, followed by a command key.




 The default command key bindings are:

[ Enter copy mode to copy text or view the history.

Function vi emacs
-------- -- -----
Half page down C-d M-Down
Half page up C-u M-Up
Next page C-f Page down
Previous page C-b Page up
Scroll down C-Down or C-e C-Down
Scroll up C-Up or C-y C-Up
Search again n n
Search again in reverse N N
Search backward ? C-r
Search forward / C-s


Plus a bunch more. Note that you have to press C-b twice if you use that for page up since C-b is bound as the command key. See the man page for information on prefacing a copy mode command with a repeat count.



You can set the key binding mode using Ctrl-b, then



:set-window-option mode-keys emacs


or vi.






share|improve this answer





















  • 14





    I think C-b = is choose-buffer by default. Did you mean C-b [ (which is copy-mode by default)? Also you can also use C-b PageUp to start copy-mode directly on the previous page (very handy when you know what you want to view/copy has already scrolled off the current page).

    – Chris Johnsen
    Nov 11 '10 at 5:55








  • 4





    Correct, my tmux has no scroll-mode. You need to C-b [ to enter copy mode and then use either the emacs or vi key-bindings to scroll around. This seems like a lot of steps just to scroll, but the benefits of tmux still outweigh these annoyances. I'm on a macbook and there is no PageUp key :-. (Also, how do I make keys with markdown like you did, Dennis?)

    – chadoh
    Nov 11 '10 at 17:11








  • 39





    @chadoh: Try these on your Macbook: Home: fn-LeftArrow; End: fn-RightArrow; Page Up: fn-UpArrow; Page Down: fn-DownArrow. To make keycaps: <kbd>Ctrl</kbd>

    – Dennis Williamson
    Nov 11 '10 at 18:43








  • 4





    on macbook, the fn+up goes straight to terminal app and never hits tmux

    – Tyler
    Apr 11 '11 at 17:57






  • 14





    On a macbook if you're in scroll mode you can use fn+Shift+LeftArrow to scroll up a page.

    – Nick Hammond
    May 18 '13 at 17:51



















271














Well, you should consider the proper way to set scrolling:
add in your tmux.conf



set -g mouse on        #For tmux version 2.1 and up


or



set -g mode-mouse on   #For tmux versions < 2.1


It worked for me in windows and panes. Now tmux is just perfect.



Practical tmux has more info on tmux.conf files.






share|improve this answer





















  • 5





    When I do this, mouse clicks and scrolls cause gibberish characters to be printed to the prompt area of the terminal I'm using with tmux. Any ideas?

    – ely
    Aug 1 '13 at 15:38






  • 15





    Future tmux mouse users: To save you having to scroll to the bottom again before typing, you can hit q to exit scroll mode.

    – Jezen Thomas
    Jan 7 '14 at 5:11








  • 13





    Mouse scrolling works fine with this, but unfortunately I cannot use the mouse to select text anymore. Using Tilda and tmux.

    – friederbluemle
    Mar 17 '15 at 3:40






  • 27





    Note that in tmux 2.1 and up, this is replaced with set -g mouse on, and scrolling does not automatically enter copy mode like it did before.

    – thrnio
    Oct 29 '15 at 22:49








  • 21





    Important note: This setting breaks highlighting and copying text. Use shift+click to maintain this functionality.

    – Shadoninja
    May 4 '16 at 22:50





















135














From my .tmux.conf:



# Sane scrolling
set -g terminal-overrides 'xterm*:smcup@:rmcup@'


This enables native xterm scrolling.






share|improve this answer





















  • 27





    Can you explain what this does exactly?

    – Ivo
    Oct 31 '11 at 6:25






  • 11





    I don't know what it does, but it is pure genius. Finally, tmux scrolling works, yay!

    – oneself
    Nov 28 '11 at 21:26






  • 5





    This doesn't work for me on OS X...

    – Nick
    Apr 17 '12 at 13:56






  • 17





    Solution: gist.github.com/1297707

    – Nick
    Apr 17 '12 at 15:25






  • 5





    Check this out if you're confused about togdon's answer: superuser.com/questions/310251/… IMO, if you have only a single pane, this solution works better than the accepted answer.

    – thameera
    Apr 16 '13 at 7:48





















46














For the newest tmux 2.1, to scroll with your mouse sanely, this is the right answer:



set -g mouse on
" sane scrolling:
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'copy-mode -e; send-keys -M'"


it's not enough to just reload your .tmux.conf you need to restart your tmux, e.g. tmux kill-server && tmux



taken from https://github.com/tmux/tmux/issues/145






share|improve this answer



















  • 1





    How is this not the accepted answer?

    – Marcel
    Dec 21 '16 at 20:28






  • 2





    the note in this answer about "not being enough to simply reload .tmux.conf helped" and exiting all tmux sessions for me (maybe kill-server would work) helped!

    – Colin D
    Jan 25 '17 at 18:05








  • 1





    could you elaborate on how this works?

    – oligofren
    Jul 19 '17 at 7:31











  • It appears to forward mouse events when the mouse is clicked/scrolled/etc. if the pane is in any indirect/buffered state (just copy-mode?), and the mouse is pressing a button, scrolling, etc. The last portion covers scrolling in direct mode by switching to an indirect mode first. If not for those controls, the terminal might interpret the events as history scrolling, if at all. With that said, I don't know if I've ever been able to get my pager and Vim to scroll correctly at the same time, and I've tried a bunch of the snippets going around.

    – John P
    Jan 2 '18 at 14:13






  • 1





    @chefarov - per a comment on another answer, you can do this via Shift+click when you have mouse mode on.

    – Brendan Moore
    Mar 27 at 13:23



















13














In my case, just opt + UpArrow and opt + DownArrow on OSX.






share|improve this answer


























  • @fixer1234 The question does not mention Linux at all. tmux can be used on OS X, too.

    – slhck
    Apr 17 '15 at 11:51











  • @slhck: Thanks. Too bleary-eyed; astigmatism kicked in. I had misread the tmux tag as a linux tag.

    – fixer1234
    Apr 17 '15 at 16:07



















11














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 ~/.tmux.conf.



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).



set -g prefix C-j
unbind C-b
bind C-j send-prefix


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 ls command to view files in a directory), and 3) could be thought of as mnemonic for "scroll" (although the copy-mode isn't just about scrolling).



bind s copy-mode


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.



bind -t emacs-copy 'p' scroll-up
bind -t emacs-copy 'n' scroll-down
bind -t emacs-copy 'i' scroll-up
bind -t emacs-copy 'k' scroll-down





share|improve this answer































    7














    I searched around a lot for this and the best solution for me works as mentioned in this detailed guide:
    http://tangledhelix.com/blog/2012/07/16/tmux-and-mouse-mode/



    Add these bindings in ~/.tmux.conf:



    set -g mode-mouse on

    unbind +
    bind +
    new-window -d -n tmux-zoom 'clear && echo TMUX ZOOM && read' ;
    swap-pane -s tmux-zoom.0 ;
    select-window -t tmux-zoom

    unbind -
    bind -
    last-window ;
    swap-pane -s tmux-zoom.0 ;
    kill-window -t tmux-zoom


    With the above approach implemented, you can copy from panes in a window as well by zooming into each pane first using Prefix +.



    One important detail that was missing with the mouse mode is to press Shift before selecting an area to copy. This will copy it to traditional terminal buffer instead of the tmux copy buffer. (https://wiki.archlinux.org/index.php/Tmux#Scrolling_issues)






    share|improve this answer


























    • Appreciate your answer. But many a times the referred links may break. It would always be beneficial to add the core part of your answer here and provide the link just for reference.

      – Prasanna
      Mar 31 '16 at 1:14



















    6














    I'd recommend giving a try to the tmux-better-mouse-mode plugin to solve most of your tmux mouse related issues.



    It's compatible with Tmux 2.1+ and the new set-option -g mouse on approach.






    share|improve this answer



















    • 1





      Thanks, this is the best solution for me. It covers all my mouse wheel bindings that I've added manually (so I don't need them anymore), and there are two killer-features that I wanted very much: scroll-without-changing-pane in combination with scroll-without-changing-pane and emulate-scroll-for-no-mouse-alternate-buffer. Now my tmux usage experience is way, way better.

      – selurvedu
      Jun 5 '18 at 11:02





















    6














    The only thing that works for me is putting the following in ~/.tmux.conf



    # Allow xterm titles in terminal window, terminal scrolling with scrollbar, and setting overrides of C-Up, C-Down, C-Left, C-Right
    set -g terminal-overrides "xterm*:XT:smcup@:rmcup@:kUP5=eOA:kDN5=eOB:kLFT5=eOD:kRIT5=eOC"


    (you may need to reboot for this to take effect)



    Update:



    I found that if you change the setting in Putty Connection > Data > Terminal-type to "putty" (used to fix some formatting issues) from "xterm" then this solution stops working.



    Update 2:



    Use this if you want "putty" as your terminal type: set -g terminal-overrides "putty*:XT:smcup@:rmcup@:kUP5=eOA:kDN5=eOB:kLFT5=eOD:kRIT5=eOC"






    share|improve this answer





















    • 2





      This one actually solves my scrolling problem in iPhone app as well.

      – NathaneilCapital
      Jun 17 '16 at 17:20











    • The latest I tried this wasn't working any more, but this worked. Strange. set -ga terminal-overrides ',xterm*:smcup@:rmcup@'

      – phocks
      Jul 5 '16 at 5:30



















    2














    This worked for me:



    vim ~/.tmux.conf
    set -g mode-mouse on ###Insert this setting with vim, then source the file.
    tmux source-file ~/.tmux.conf





    share|improve this answer



















    • 1





      Since the version 2.1 (18 October 2015) the option should be set -g mouse on

      – naoko
      Dec 27 '18 at 0:07



















    0














    The only thing that worked for me was
    vim ~/.tmux.conf
    set -g mode-mouse on ###Insert this setting with vim, then source the file.
    tmux source-file ~/.tmux.conf






    share|improve this answer








    New contributor




    Sarika Soni is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.





















    • Could you use some formatting to make this more clear? Use the EDIT button and then look at the options available in the editor to add the helpful formats.

      – music2myear
      10 hours ago



















    -1
















    • Ctrl + A - to start scrolling


    • Ctrl + C - to stop scrolling






    share|improve this answer





















    • 2





      This post is too short to be usefully answer the question. It adds very little new information to answers already posted; it says nothing about how to scroll (only how to change in and out of copy mode). Also, the default command prefix key combination is Ctrl-B (Ctrl-Ais the default for GNU screen).

      – Anthony Geoghegan
      Oct 26 '16 at 8:50













    • Not sure if the author of this answer even understood the question. It's unhelpful and just wrong.

      – Vik
      Mar 30 '17 at 7:53






    • 1





      I've been looking for how to stop scrolling for so long, thanks for pointing it out!

      – PERR0_HUNTER
      Apr 9 '17 at 17:12












    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "3"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f209437%2fhow-do-i-scroll-in-tmux%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    12 Answers
    12






    active

    oldest

    votes








    12 Answers
    12






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1440














    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)



    In vi mode (see below), you can also scroll the page up/down line by line using Shift-k and Shift-j (if you're already in scroll mode). Unshifted, the cursor moves instead of the page.



    Excerpts from the man page:




    tmux may be controlled from an attached client by using a key combination of a prefix key, ‘C-b’ (Ctrl-b) by default, followed by a command key.




     The default command key bindings are:

    [ Enter copy mode to copy text or view the history.

    Function vi emacs
    -------- -- -----
    Half page down C-d M-Down
    Half page up C-u M-Up
    Next page C-f Page down
    Previous page C-b Page up
    Scroll down C-Down or C-e C-Down
    Scroll up C-Up or C-y C-Up
    Search again n n
    Search again in reverse N N
    Search backward ? C-r
    Search forward / C-s


    Plus a bunch more. Note that you have to press C-b twice if you use that for page up since C-b is bound as the command key. See the man page for information on prefacing a copy mode command with a repeat count.



    You can set the key binding mode using Ctrl-b, then



    :set-window-option mode-keys emacs


    or vi.






    share|improve this answer





















    • 14





      I think C-b = is choose-buffer by default. Did you mean C-b [ (which is copy-mode by default)? Also you can also use C-b PageUp to start copy-mode directly on the previous page (very handy when you know what you want to view/copy has already scrolled off the current page).

      – Chris Johnsen
      Nov 11 '10 at 5:55








    • 4





      Correct, my tmux has no scroll-mode. You need to C-b [ to enter copy mode and then use either the emacs or vi key-bindings to scroll around. This seems like a lot of steps just to scroll, but the benefits of tmux still outweigh these annoyances. I'm on a macbook and there is no PageUp key :-. (Also, how do I make keys with markdown like you did, Dennis?)

      – chadoh
      Nov 11 '10 at 17:11








    • 39





      @chadoh: Try these on your Macbook: Home: fn-LeftArrow; End: fn-RightArrow; Page Up: fn-UpArrow; Page Down: fn-DownArrow. To make keycaps: <kbd>Ctrl</kbd>

      – Dennis Williamson
      Nov 11 '10 at 18:43








    • 4





      on macbook, the fn+up goes straight to terminal app and never hits tmux

      – Tyler
      Apr 11 '11 at 17:57






    • 14





      On a macbook if you're in scroll mode you can use fn+Shift+LeftArrow to scroll up a page.

      – Nick Hammond
      May 18 '13 at 17:51
















    1440














    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)



    In vi mode (see below), you can also scroll the page up/down line by line using Shift-k and Shift-j (if you're already in scroll mode). Unshifted, the cursor moves instead of the page.



    Excerpts from the man page:




    tmux may be controlled from an attached client by using a key combination of a prefix key, ‘C-b’ (Ctrl-b) by default, followed by a command key.




     The default command key bindings are:

    [ Enter copy mode to copy text or view the history.

    Function vi emacs
    -------- -- -----
    Half page down C-d M-Down
    Half page up C-u M-Up
    Next page C-f Page down
    Previous page C-b Page up
    Scroll down C-Down or C-e C-Down
    Scroll up C-Up or C-y C-Up
    Search again n n
    Search again in reverse N N
    Search backward ? C-r
    Search forward / C-s


    Plus a bunch more. Note that you have to press C-b twice if you use that for page up since C-b is bound as the command key. See the man page for information on prefacing a copy mode command with a repeat count.



    You can set the key binding mode using Ctrl-b, then



    :set-window-option mode-keys emacs


    or vi.






    share|improve this answer





















    • 14





      I think C-b = is choose-buffer by default. Did you mean C-b [ (which is copy-mode by default)? Also you can also use C-b PageUp to start copy-mode directly on the previous page (very handy when you know what you want to view/copy has already scrolled off the current page).

      – Chris Johnsen
      Nov 11 '10 at 5:55








    • 4





      Correct, my tmux has no scroll-mode. You need to C-b [ to enter copy mode and then use either the emacs or vi key-bindings to scroll around. This seems like a lot of steps just to scroll, but the benefits of tmux still outweigh these annoyances. I'm on a macbook and there is no PageUp key :-. (Also, how do I make keys with markdown like you did, Dennis?)

      – chadoh
      Nov 11 '10 at 17:11








    • 39





      @chadoh: Try these on your Macbook: Home: fn-LeftArrow; End: fn-RightArrow; Page Up: fn-UpArrow; Page Down: fn-DownArrow. To make keycaps: <kbd>Ctrl</kbd>

      – Dennis Williamson
      Nov 11 '10 at 18:43








    • 4





      on macbook, the fn+up goes straight to terminal app and never hits tmux

      – Tyler
      Apr 11 '11 at 17:57






    • 14





      On a macbook if you're in scroll mode you can use fn+Shift+LeftArrow to scroll up a page.

      – Nick Hammond
      May 18 '13 at 17:51














    1440












    1440








    1440







    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)



    In vi mode (see below), you can also scroll the page up/down line by line using Shift-k and Shift-j (if you're already in scroll mode). Unshifted, the cursor moves instead of the page.



    Excerpts from the man page:




    tmux may be controlled from an attached client by using a key combination of a prefix key, ‘C-b’ (Ctrl-b) by default, followed by a command key.




     The default command key bindings are:

    [ Enter copy mode to copy text or view the history.

    Function vi emacs
    -------- -- -----
    Half page down C-d M-Down
    Half page up C-u M-Up
    Next page C-f Page down
    Previous page C-b Page up
    Scroll down C-Down or C-e C-Down
    Scroll up C-Up or C-y C-Up
    Search again n n
    Search again in reverse N N
    Search backward ? C-r
    Search forward / C-s


    Plus a bunch more. Note that you have to press C-b twice if you use that for page up since C-b is bound as the command key. See the man page for information on prefacing a copy mode command with a repeat count.



    You can set the key binding mode using Ctrl-b, then



    :set-window-option mode-keys emacs


    or vi.






    share|improve this answer















    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)



    In vi mode (see below), you can also scroll the page up/down line by line using Shift-k and Shift-j (if you're already in scroll mode). Unshifted, the cursor moves instead of the page.



    Excerpts from the man page:




    tmux may be controlled from an attached client by using a key combination of a prefix key, ‘C-b’ (Ctrl-b) by default, followed by a command key.




     The default command key bindings are:

    [ Enter copy mode to copy text or view the history.

    Function vi emacs
    -------- -- -----
    Half page down C-d M-Down
    Half page up C-u M-Up
    Next page C-f Page down
    Previous page C-b Page up
    Scroll down C-Down or C-e C-Down
    Scroll up C-Up or C-y C-Up
    Search again n n
    Search again in reverse N N
    Search backward ? C-r
    Search forward / C-s


    Plus a bunch more. Note that you have to press C-b twice if you use that for page up since C-b is bound as the command key. See the man page for information on prefacing a copy mode command with a repeat count.



    You can set the key binding mode using Ctrl-b, then



    :set-window-option mode-keys emacs


    or vi.







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Jan 26 '16 at 1:01

























    answered Nov 11 '10 at 3:02









    Dennis WilliamsonDennis Williamson

    78.5k14131167




    78.5k14131167








    • 14





      I think C-b = is choose-buffer by default. Did you mean C-b [ (which is copy-mode by default)? Also you can also use C-b PageUp to start copy-mode directly on the previous page (very handy when you know what you want to view/copy has already scrolled off the current page).

      – Chris Johnsen
      Nov 11 '10 at 5:55








    • 4





      Correct, my tmux has no scroll-mode. You need to C-b [ to enter copy mode and then use either the emacs or vi key-bindings to scroll around. This seems like a lot of steps just to scroll, but the benefits of tmux still outweigh these annoyances. I'm on a macbook and there is no PageUp key :-. (Also, how do I make keys with markdown like you did, Dennis?)

      – chadoh
      Nov 11 '10 at 17:11








    • 39





      @chadoh: Try these on your Macbook: Home: fn-LeftArrow; End: fn-RightArrow; Page Up: fn-UpArrow; Page Down: fn-DownArrow. To make keycaps: <kbd>Ctrl</kbd>

      – Dennis Williamson
      Nov 11 '10 at 18:43








    • 4





      on macbook, the fn+up goes straight to terminal app and never hits tmux

      – Tyler
      Apr 11 '11 at 17:57






    • 14





      On a macbook if you're in scroll mode you can use fn+Shift+LeftArrow to scroll up a page.

      – Nick Hammond
      May 18 '13 at 17:51














    • 14





      I think C-b = is choose-buffer by default. Did you mean C-b [ (which is copy-mode by default)? Also you can also use C-b PageUp to start copy-mode directly on the previous page (very handy when you know what you want to view/copy has already scrolled off the current page).

      – Chris Johnsen
      Nov 11 '10 at 5:55








    • 4





      Correct, my tmux has no scroll-mode. You need to C-b [ to enter copy mode and then use either the emacs or vi key-bindings to scroll around. This seems like a lot of steps just to scroll, but the benefits of tmux still outweigh these annoyances. I'm on a macbook and there is no PageUp key :-. (Also, how do I make keys with markdown like you did, Dennis?)

      – chadoh
      Nov 11 '10 at 17:11








    • 39





      @chadoh: Try these on your Macbook: Home: fn-LeftArrow; End: fn-RightArrow; Page Up: fn-UpArrow; Page Down: fn-DownArrow. To make keycaps: <kbd>Ctrl</kbd>

      – Dennis Williamson
      Nov 11 '10 at 18:43








    • 4





      on macbook, the fn+up goes straight to terminal app and never hits tmux

      – Tyler
      Apr 11 '11 at 17:57






    • 14





      On a macbook if you're in scroll mode you can use fn+Shift+LeftArrow to scroll up a page.

      – Nick Hammond
      May 18 '13 at 17:51








    14




    14





    I think C-b = is choose-buffer by default. Did you mean C-b [ (which is copy-mode by default)? Also you can also use C-b PageUp to start copy-mode directly on the previous page (very handy when you know what you want to view/copy has already scrolled off the current page).

    – Chris Johnsen
    Nov 11 '10 at 5:55







    I think C-b = is choose-buffer by default. Did you mean C-b [ (which is copy-mode by default)? Also you can also use C-b PageUp to start copy-mode directly on the previous page (very handy when you know what you want to view/copy has already scrolled off the current page).

    – Chris Johnsen
    Nov 11 '10 at 5:55






    4




    4





    Correct, my tmux has no scroll-mode. You need to C-b [ to enter copy mode and then use either the emacs or vi key-bindings to scroll around. This seems like a lot of steps just to scroll, but the benefits of tmux still outweigh these annoyances. I'm on a macbook and there is no PageUp key :-. (Also, how do I make keys with markdown like you did, Dennis?)

    – chadoh
    Nov 11 '10 at 17:11







    Correct, my tmux has no scroll-mode. You need to C-b [ to enter copy mode and then use either the emacs or vi key-bindings to scroll around. This seems like a lot of steps just to scroll, but the benefits of tmux still outweigh these annoyances. I'm on a macbook and there is no PageUp key :-. (Also, how do I make keys with markdown like you did, Dennis?)

    – chadoh
    Nov 11 '10 at 17:11






    39




    39





    @chadoh: Try these on your Macbook: Home: fn-LeftArrow; End: fn-RightArrow; Page Up: fn-UpArrow; Page Down: fn-DownArrow. To make keycaps: <kbd>Ctrl</kbd>

    – Dennis Williamson
    Nov 11 '10 at 18:43







    @chadoh: Try these on your Macbook: Home: fn-LeftArrow; End: fn-RightArrow; Page Up: fn-UpArrow; Page Down: fn-DownArrow. To make keycaps: <kbd>Ctrl</kbd>

    – Dennis Williamson
    Nov 11 '10 at 18:43






    4




    4





    on macbook, the fn+up goes straight to terminal app and never hits tmux

    – Tyler
    Apr 11 '11 at 17:57





    on macbook, the fn+up goes straight to terminal app and never hits tmux

    – Tyler
    Apr 11 '11 at 17:57




    14




    14





    On a macbook if you're in scroll mode you can use fn+Shift+LeftArrow to scroll up a page.

    – Nick Hammond
    May 18 '13 at 17:51





    On a macbook if you're in scroll mode you can use fn+Shift+LeftArrow to scroll up a page.

    – Nick Hammond
    May 18 '13 at 17:51













    271














    Well, you should consider the proper way to set scrolling:
    add in your tmux.conf



    set -g mouse on        #For tmux version 2.1 and up


    or



    set -g mode-mouse on   #For tmux versions < 2.1


    It worked for me in windows and panes. Now tmux is just perfect.



    Practical tmux has more info on tmux.conf files.






    share|improve this answer





















    • 5





      When I do this, mouse clicks and scrolls cause gibberish characters to be printed to the prompt area of the terminal I'm using with tmux. Any ideas?

      – ely
      Aug 1 '13 at 15:38






    • 15





      Future tmux mouse users: To save you having to scroll to the bottom again before typing, you can hit q to exit scroll mode.

      – Jezen Thomas
      Jan 7 '14 at 5:11








    • 13





      Mouse scrolling works fine with this, but unfortunately I cannot use the mouse to select text anymore. Using Tilda and tmux.

      – friederbluemle
      Mar 17 '15 at 3:40






    • 27





      Note that in tmux 2.1 and up, this is replaced with set -g mouse on, and scrolling does not automatically enter copy mode like it did before.

      – thrnio
      Oct 29 '15 at 22:49








    • 21





      Important note: This setting breaks highlighting and copying text. Use shift+click to maintain this functionality.

      – Shadoninja
      May 4 '16 at 22:50


















    271














    Well, you should consider the proper way to set scrolling:
    add in your tmux.conf



    set -g mouse on        #For tmux version 2.1 and up


    or



    set -g mode-mouse on   #For tmux versions < 2.1


    It worked for me in windows and panes. Now tmux is just perfect.



    Practical tmux has more info on tmux.conf files.






    share|improve this answer





















    • 5





      When I do this, mouse clicks and scrolls cause gibberish characters to be printed to the prompt area of the terminal I'm using with tmux. Any ideas?

      – ely
      Aug 1 '13 at 15:38






    • 15





      Future tmux mouse users: To save you having to scroll to the bottom again before typing, you can hit q to exit scroll mode.

      – Jezen Thomas
      Jan 7 '14 at 5:11








    • 13





      Mouse scrolling works fine with this, but unfortunately I cannot use the mouse to select text anymore. Using Tilda and tmux.

      – friederbluemle
      Mar 17 '15 at 3:40






    • 27





      Note that in tmux 2.1 and up, this is replaced with set -g mouse on, and scrolling does not automatically enter copy mode like it did before.

      – thrnio
      Oct 29 '15 at 22:49








    • 21





      Important note: This setting breaks highlighting and copying text. Use shift+click to maintain this functionality.

      – Shadoninja
      May 4 '16 at 22:50
















    271












    271








    271







    Well, you should consider the proper way to set scrolling:
    add in your tmux.conf



    set -g mouse on        #For tmux version 2.1 and up


    or



    set -g mode-mouse on   #For tmux versions < 2.1


    It worked for me in windows and panes. Now tmux is just perfect.



    Practical tmux has more info on tmux.conf files.






    share|improve this answer















    Well, you should consider the proper way to set scrolling:
    add in your tmux.conf



    set -g mouse on        #For tmux version 2.1 and up


    or



    set -g mode-mouse on   #For tmux versions < 2.1


    It worked for me in windows and panes. Now tmux is just perfect.



    Practical tmux has more info on tmux.conf files.







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Jan 4 '18 at 22:10









    Zain R

    11917




    11917










    answered Nov 25 '12 at 13:05









    chaiyachaiyachaiyachaiya

    2,719182




    2,719182








    • 5





      When I do this, mouse clicks and scrolls cause gibberish characters to be printed to the prompt area of the terminal I'm using with tmux. Any ideas?

      – ely
      Aug 1 '13 at 15:38






    • 15





      Future tmux mouse users: To save you having to scroll to the bottom again before typing, you can hit q to exit scroll mode.

      – Jezen Thomas
      Jan 7 '14 at 5:11








    • 13





      Mouse scrolling works fine with this, but unfortunately I cannot use the mouse to select text anymore. Using Tilda and tmux.

      – friederbluemle
      Mar 17 '15 at 3:40






    • 27





      Note that in tmux 2.1 and up, this is replaced with set -g mouse on, and scrolling does not automatically enter copy mode like it did before.

      – thrnio
      Oct 29 '15 at 22:49








    • 21





      Important note: This setting breaks highlighting and copying text. Use shift+click to maintain this functionality.

      – Shadoninja
      May 4 '16 at 22:50
















    • 5





      When I do this, mouse clicks and scrolls cause gibberish characters to be printed to the prompt area of the terminal I'm using with tmux. Any ideas?

      – ely
      Aug 1 '13 at 15:38






    • 15





      Future tmux mouse users: To save you having to scroll to the bottom again before typing, you can hit q to exit scroll mode.

      – Jezen Thomas
      Jan 7 '14 at 5:11








    • 13





      Mouse scrolling works fine with this, but unfortunately I cannot use the mouse to select text anymore. Using Tilda and tmux.

      – friederbluemle
      Mar 17 '15 at 3:40






    • 27





      Note that in tmux 2.1 and up, this is replaced with set -g mouse on, and scrolling does not automatically enter copy mode like it did before.

      – thrnio
      Oct 29 '15 at 22:49








    • 21





      Important note: This setting breaks highlighting and copying text. Use shift+click to maintain this functionality.

      – Shadoninja
      May 4 '16 at 22:50










    5




    5





    When I do this, mouse clicks and scrolls cause gibberish characters to be printed to the prompt area of the terminal I'm using with tmux. Any ideas?

    – ely
    Aug 1 '13 at 15:38





    When I do this, mouse clicks and scrolls cause gibberish characters to be printed to the prompt area of the terminal I'm using with tmux. Any ideas?

    – ely
    Aug 1 '13 at 15:38




    15




    15





    Future tmux mouse users: To save you having to scroll to the bottom again before typing, you can hit q to exit scroll mode.

    – Jezen Thomas
    Jan 7 '14 at 5:11







    Future tmux mouse users: To save you having to scroll to the bottom again before typing, you can hit q to exit scroll mode.

    – Jezen Thomas
    Jan 7 '14 at 5:11






    13




    13





    Mouse scrolling works fine with this, but unfortunately I cannot use the mouse to select text anymore. Using Tilda and tmux.

    – friederbluemle
    Mar 17 '15 at 3:40





    Mouse scrolling works fine with this, but unfortunately I cannot use the mouse to select text anymore. Using Tilda and tmux.

    – friederbluemle
    Mar 17 '15 at 3:40




    27




    27





    Note that in tmux 2.1 and up, this is replaced with set -g mouse on, and scrolling does not automatically enter copy mode like it did before.

    – thrnio
    Oct 29 '15 at 22:49







    Note that in tmux 2.1 and up, this is replaced with set -g mouse on, and scrolling does not automatically enter copy mode like it did before.

    – thrnio
    Oct 29 '15 at 22:49






    21




    21





    Important note: This setting breaks highlighting and copying text. Use shift+click to maintain this functionality.

    – Shadoninja
    May 4 '16 at 22:50







    Important note: This setting breaks highlighting and copying text. Use shift+click to maintain this functionality.

    – Shadoninja
    May 4 '16 at 22:50













    135














    From my .tmux.conf:



    # Sane scrolling
    set -g terminal-overrides 'xterm*:smcup@:rmcup@'


    This enables native xterm scrolling.






    share|improve this answer





















    • 27





      Can you explain what this does exactly?

      – Ivo
      Oct 31 '11 at 6:25






    • 11





      I don't know what it does, but it is pure genius. Finally, tmux scrolling works, yay!

      – oneself
      Nov 28 '11 at 21:26






    • 5





      This doesn't work for me on OS X...

      – Nick
      Apr 17 '12 at 13:56






    • 17





      Solution: gist.github.com/1297707

      – Nick
      Apr 17 '12 at 15:25






    • 5





      Check this out if you're confused about togdon's answer: superuser.com/questions/310251/… IMO, if you have only a single pane, this solution works better than the accepted answer.

      – thameera
      Apr 16 '13 at 7:48


















    135














    From my .tmux.conf:



    # Sane scrolling
    set -g terminal-overrides 'xterm*:smcup@:rmcup@'


    This enables native xterm scrolling.






    share|improve this answer





















    • 27





      Can you explain what this does exactly?

      – Ivo
      Oct 31 '11 at 6:25






    • 11





      I don't know what it does, but it is pure genius. Finally, tmux scrolling works, yay!

      – oneself
      Nov 28 '11 at 21:26






    • 5





      This doesn't work for me on OS X...

      – Nick
      Apr 17 '12 at 13:56






    • 17





      Solution: gist.github.com/1297707

      – Nick
      Apr 17 '12 at 15:25






    • 5





      Check this out if you're confused about togdon's answer: superuser.com/questions/310251/… IMO, if you have only a single pane, this solution works better than the accepted answer.

      – thameera
      Apr 16 '13 at 7:48
















    135












    135








    135







    From my .tmux.conf:



    # Sane scrolling
    set -g terminal-overrides 'xterm*:smcup@:rmcup@'


    This enables native xterm scrolling.






    share|improve this answer















    From my .tmux.conf:



    # Sane scrolling
    set -g terminal-overrides 'xterm*:smcup@:rmcup@'


    This enables native xterm scrolling.







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Mar 30 '12 at 8:35









    Community

    1




    1










    answered Aug 22 '11 at 20:49









    togdontogdon

    1,467194




    1,467194








    • 27





      Can you explain what this does exactly?

      – Ivo
      Oct 31 '11 at 6:25






    • 11





      I don't know what it does, but it is pure genius. Finally, tmux scrolling works, yay!

      – oneself
      Nov 28 '11 at 21:26






    • 5





      This doesn't work for me on OS X...

      – Nick
      Apr 17 '12 at 13:56






    • 17





      Solution: gist.github.com/1297707

      – Nick
      Apr 17 '12 at 15:25






    • 5





      Check this out if you're confused about togdon's answer: superuser.com/questions/310251/… IMO, if you have only a single pane, this solution works better than the accepted answer.

      – thameera
      Apr 16 '13 at 7:48
















    • 27





      Can you explain what this does exactly?

      – Ivo
      Oct 31 '11 at 6:25






    • 11





      I don't know what it does, but it is pure genius. Finally, tmux scrolling works, yay!

      – oneself
      Nov 28 '11 at 21:26






    • 5





      This doesn't work for me on OS X...

      – Nick
      Apr 17 '12 at 13:56






    • 17





      Solution: gist.github.com/1297707

      – Nick
      Apr 17 '12 at 15:25






    • 5





      Check this out if you're confused about togdon's answer: superuser.com/questions/310251/… IMO, if you have only a single pane, this solution works better than the accepted answer.

      – thameera
      Apr 16 '13 at 7:48










    27




    27





    Can you explain what this does exactly?

    – Ivo
    Oct 31 '11 at 6:25





    Can you explain what this does exactly?

    – Ivo
    Oct 31 '11 at 6:25




    11




    11





    I don't know what it does, but it is pure genius. Finally, tmux scrolling works, yay!

    – oneself
    Nov 28 '11 at 21:26





    I don't know what it does, but it is pure genius. Finally, tmux scrolling works, yay!

    – oneself
    Nov 28 '11 at 21:26




    5




    5





    This doesn't work for me on OS X...

    – Nick
    Apr 17 '12 at 13:56





    This doesn't work for me on OS X...

    – Nick
    Apr 17 '12 at 13:56




    17




    17





    Solution: gist.github.com/1297707

    – Nick
    Apr 17 '12 at 15:25





    Solution: gist.github.com/1297707

    – Nick
    Apr 17 '12 at 15:25




    5




    5





    Check this out if you're confused about togdon's answer: superuser.com/questions/310251/… IMO, if you have only a single pane, this solution works better than the accepted answer.

    – thameera
    Apr 16 '13 at 7:48







    Check this out if you're confused about togdon's answer: superuser.com/questions/310251/… IMO, if you have only a single pane, this solution works better than the accepted answer.

    – thameera
    Apr 16 '13 at 7:48













    46














    For the newest tmux 2.1, to scroll with your mouse sanely, this is the right answer:



    set -g mouse on
    " sane scrolling:
    bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'copy-mode -e; send-keys -M'"


    it's not enough to just reload your .tmux.conf you need to restart your tmux, e.g. tmux kill-server && tmux



    taken from https://github.com/tmux/tmux/issues/145






    share|improve this answer



















    • 1





      How is this not the accepted answer?

      – Marcel
      Dec 21 '16 at 20:28






    • 2





      the note in this answer about "not being enough to simply reload .tmux.conf helped" and exiting all tmux sessions for me (maybe kill-server would work) helped!

      – Colin D
      Jan 25 '17 at 18:05








    • 1





      could you elaborate on how this works?

      – oligofren
      Jul 19 '17 at 7:31











    • It appears to forward mouse events when the mouse is clicked/scrolled/etc. if the pane is in any indirect/buffered state (just copy-mode?), and the mouse is pressing a button, scrolling, etc. The last portion covers scrolling in direct mode by switching to an indirect mode first. If not for those controls, the terminal might interpret the events as history scrolling, if at all. With that said, I don't know if I've ever been able to get my pager and Vim to scroll correctly at the same time, and I've tried a bunch of the snippets going around.

      – John P
      Jan 2 '18 at 14:13






    • 1





      @chefarov - per a comment on another answer, you can do this via Shift+click when you have mouse mode on.

      – Brendan Moore
      Mar 27 at 13:23
















    46














    For the newest tmux 2.1, to scroll with your mouse sanely, this is the right answer:



    set -g mouse on
    " sane scrolling:
    bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'copy-mode -e; send-keys -M'"


    it's not enough to just reload your .tmux.conf you need to restart your tmux, e.g. tmux kill-server && tmux



    taken from https://github.com/tmux/tmux/issues/145






    share|improve this answer



















    • 1





      How is this not the accepted answer?

      – Marcel
      Dec 21 '16 at 20:28






    • 2





      the note in this answer about "not being enough to simply reload .tmux.conf helped" and exiting all tmux sessions for me (maybe kill-server would work) helped!

      – Colin D
      Jan 25 '17 at 18:05








    • 1





      could you elaborate on how this works?

      – oligofren
      Jul 19 '17 at 7:31











    • It appears to forward mouse events when the mouse is clicked/scrolled/etc. if the pane is in any indirect/buffered state (just copy-mode?), and the mouse is pressing a button, scrolling, etc. The last portion covers scrolling in direct mode by switching to an indirect mode first. If not for those controls, the terminal might interpret the events as history scrolling, if at all. With that said, I don't know if I've ever been able to get my pager and Vim to scroll correctly at the same time, and I've tried a bunch of the snippets going around.

      – John P
      Jan 2 '18 at 14:13






    • 1





      @chefarov - per a comment on another answer, you can do this via Shift+click when you have mouse mode on.

      – Brendan Moore
      Mar 27 at 13:23














    46












    46








    46







    For the newest tmux 2.1, to scroll with your mouse sanely, this is the right answer:



    set -g mouse on
    " sane scrolling:
    bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'copy-mode -e; send-keys -M'"


    it's not enough to just reload your .tmux.conf you need to restart your tmux, e.g. tmux kill-server && tmux



    taken from https://github.com/tmux/tmux/issues/145






    share|improve this answer













    For the newest tmux 2.1, to scroll with your mouse sanely, this is the right answer:



    set -g mouse on
    " sane scrolling:
    bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'copy-mode -e; send-keys -M'"


    it's not enough to just reload your .tmux.conf you need to restart your tmux, e.g. tmux kill-server && tmux



    taken from https://github.com/tmux/tmux/issues/145







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Dec 1 '15 at 16:09









    FlovFlov

    56144




    56144








    • 1





      How is this not the accepted answer?

      – Marcel
      Dec 21 '16 at 20:28






    • 2





      the note in this answer about "not being enough to simply reload .tmux.conf helped" and exiting all tmux sessions for me (maybe kill-server would work) helped!

      – Colin D
      Jan 25 '17 at 18:05








    • 1





      could you elaborate on how this works?

      – oligofren
      Jul 19 '17 at 7:31











    • It appears to forward mouse events when the mouse is clicked/scrolled/etc. if the pane is in any indirect/buffered state (just copy-mode?), and the mouse is pressing a button, scrolling, etc. The last portion covers scrolling in direct mode by switching to an indirect mode first. If not for those controls, the terminal might interpret the events as history scrolling, if at all. With that said, I don't know if I've ever been able to get my pager and Vim to scroll correctly at the same time, and I've tried a bunch of the snippets going around.

      – John P
      Jan 2 '18 at 14:13






    • 1





      @chefarov - per a comment on another answer, you can do this via Shift+click when you have mouse mode on.

      – Brendan Moore
      Mar 27 at 13:23














    • 1





      How is this not the accepted answer?

      – Marcel
      Dec 21 '16 at 20:28






    • 2





      the note in this answer about "not being enough to simply reload .tmux.conf helped" and exiting all tmux sessions for me (maybe kill-server would work) helped!

      – Colin D
      Jan 25 '17 at 18:05








    • 1





      could you elaborate on how this works?

      – oligofren
      Jul 19 '17 at 7:31











    • It appears to forward mouse events when the mouse is clicked/scrolled/etc. if the pane is in any indirect/buffered state (just copy-mode?), and the mouse is pressing a button, scrolling, etc. The last portion covers scrolling in direct mode by switching to an indirect mode first. If not for those controls, the terminal might interpret the events as history scrolling, if at all. With that said, I don't know if I've ever been able to get my pager and Vim to scroll correctly at the same time, and I've tried a bunch of the snippets going around.

      – John P
      Jan 2 '18 at 14:13






    • 1





      @chefarov - per a comment on another answer, you can do this via Shift+click when you have mouse mode on.

      – Brendan Moore
      Mar 27 at 13:23








    1




    1





    How is this not the accepted answer?

    – Marcel
    Dec 21 '16 at 20:28





    How is this not the accepted answer?

    – Marcel
    Dec 21 '16 at 20:28




    2




    2





    the note in this answer about "not being enough to simply reload .tmux.conf helped" and exiting all tmux sessions for me (maybe kill-server would work) helped!

    – Colin D
    Jan 25 '17 at 18:05







    the note in this answer about "not being enough to simply reload .tmux.conf helped" and exiting all tmux sessions for me (maybe kill-server would work) helped!

    – Colin D
    Jan 25 '17 at 18:05






    1




    1





    could you elaborate on how this works?

    – oligofren
    Jul 19 '17 at 7:31





    could you elaborate on how this works?

    – oligofren
    Jul 19 '17 at 7:31













    It appears to forward mouse events when the mouse is clicked/scrolled/etc. if the pane is in any indirect/buffered state (just copy-mode?), and the mouse is pressing a button, scrolling, etc. The last portion covers scrolling in direct mode by switching to an indirect mode first. If not for those controls, the terminal might interpret the events as history scrolling, if at all. With that said, I don't know if I've ever been able to get my pager and Vim to scroll correctly at the same time, and I've tried a bunch of the snippets going around.

    – John P
    Jan 2 '18 at 14:13





    It appears to forward mouse events when the mouse is clicked/scrolled/etc. if the pane is in any indirect/buffered state (just copy-mode?), and the mouse is pressing a button, scrolling, etc. The last portion covers scrolling in direct mode by switching to an indirect mode first. If not for those controls, the terminal might interpret the events as history scrolling, if at all. With that said, I don't know if I've ever been able to get my pager and Vim to scroll correctly at the same time, and I've tried a bunch of the snippets going around.

    – John P
    Jan 2 '18 at 14:13




    1




    1





    @chefarov - per a comment on another answer, you can do this via Shift+click when you have mouse mode on.

    – Brendan Moore
    Mar 27 at 13:23





    @chefarov - per a comment on another answer, you can do this via Shift+click when you have mouse mode on.

    – Brendan Moore
    Mar 27 at 13:23











    13














    In my case, just opt + UpArrow and opt + DownArrow on OSX.






    share|improve this answer


























    • @fixer1234 The question does not mention Linux at all. tmux can be used on OS X, too.

      – slhck
      Apr 17 '15 at 11:51











    • @slhck: Thanks. Too bleary-eyed; astigmatism kicked in. I had misread the tmux tag as a linux tag.

      – fixer1234
      Apr 17 '15 at 16:07
















    13














    In my case, just opt + UpArrow and opt + DownArrow on OSX.






    share|improve this answer


























    • @fixer1234 The question does not mention Linux at all. tmux can be used on OS X, too.

      – slhck
      Apr 17 '15 at 11:51











    • @slhck: Thanks. Too bleary-eyed; astigmatism kicked in. I had misread the tmux tag as a linux tag.

      – fixer1234
      Apr 17 '15 at 16:07














    13












    13








    13







    In my case, just opt + UpArrow and opt + DownArrow on OSX.






    share|improve this answer















    In my case, just opt + UpArrow and opt + DownArrow on OSX.







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Apr 17 '15 at 4:14









    Varaquilex

    2,71032247




    2,71032247










    answered Apr 17 '15 at 3:43









    ythdelmarythdelmar

    23123




    23123













    • @fixer1234 The question does not mention Linux at all. tmux can be used on OS X, too.

      – slhck
      Apr 17 '15 at 11:51











    • @slhck: Thanks. Too bleary-eyed; astigmatism kicked in. I had misread the tmux tag as a linux tag.

      – fixer1234
      Apr 17 '15 at 16:07



















    • @fixer1234 The question does not mention Linux at all. tmux can be used on OS X, too.

      – slhck
      Apr 17 '15 at 11:51











    • @slhck: Thanks. Too bleary-eyed; astigmatism kicked in. I had misread the tmux tag as a linux tag.

      – fixer1234
      Apr 17 '15 at 16:07

















    @fixer1234 The question does not mention Linux at all. tmux can be used on OS X, too.

    – slhck
    Apr 17 '15 at 11:51





    @fixer1234 The question does not mention Linux at all. tmux can be used on OS X, too.

    – slhck
    Apr 17 '15 at 11:51













    @slhck: Thanks. Too bleary-eyed; astigmatism kicked in. I had misread the tmux tag as a linux tag.

    – fixer1234
    Apr 17 '15 at 16:07





    @slhck: Thanks. Too bleary-eyed; astigmatism kicked in. I had misread the tmux tag as a linux tag.

    – fixer1234
    Apr 17 '15 at 16:07











    11














    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 ~/.tmux.conf.



    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).



    set -g prefix C-j
    unbind C-b
    bind C-j send-prefix


    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 ls command to view files in a directory), and 3) could be thought of as mnemonic for "scroll" (although the copy-mode isn't just about scrolling).



    bind s copy-mode


    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.



    bind -t emacs-copy 'p' scroll-up
    bind -t emacs-copy 'n' scroll-down
    bind -t emacs-copy 'i' scroll-up
    bind -t emacs-copy 'k' scroll-down





    share|improve this answer




























      11














      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 ~/.tmux.conf.



      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).



      set -g prefix C-j
      unbind C-b
      bind C-j send-prefix


      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 ls command to view files in a directory), and 3) could be thought of as mnemonic for "scroll" (although the copy-mode isn't just about scrolling).



      bind s copy-mode


      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.



      bind -t emacs-copy 'p' scroll-up
      bind -t emacs-copy 'n' scroll-down
      bind -t emacs-copy 'i' scroll-up
      bind -t emacs-copy 'k' scroll-down





      share|improve this answer


























        11












        11








        11







        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 ~/.tmux.conf.



        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).



        set -g prefix C-j
        unbind C-b
        bind C-j send-prefix


        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 ls command to view files in a directory), and 3) could be thought of as mnemonic for "scroll" (although the copy-mode isn't just about scrolling).



        bind s copy-mode


        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.



        bind -t emacs-copy 'p' scroll-up
        bind -t emacs-copy 'n' scroll-down
        bind -t emacs-copy 'i' scroll-up
        bind -t emacs-copy 'k' scroll-down





        share|improve this answer













        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 ~/.tmux.conf.



        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).



        set -g prefix C-j
        unbind C-b
        bind C-j send-prefix


        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 ls command to view files in a directory), and 3) could be thought of as mnemonic for "scroll" (although the copy-mode isn't just about scrolling).



        bind s copy-mode


        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.



        bind -t emacs-copy 'p' scroll-up
        bind -t emacs-copy 'n' scroll-down
        bind -t emacs-copy 'i' scroll-up
        bind -t emacs-copy 'k' scroll-down






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jun 21 '13 at 15:33









        Emanuel BergEmanuel Berg

        354411




        354411























            7














            I searched around a lot for this and the best solution for me works as mentioned in this detailed guide:
            http://tangledhelix.com/blog/2012/07/16/tmux-and-mouse-mode/



            Add these bindings in ~/.tmux.conf:



            set -g mode-mouse on

            unbind +
            bind +
            new-window -d -n tmux-zoom 'clear && echo TMUX ZOOM && read' ;
            swap-pane -s tmux-zoom.0 ;
            select-window -t tmux-zoom

            unbind -
            bind -
            last-window ;
            swap-pane -s tmux-zoom.0 ;
            kill-window -t tmux-zoom


            With the above approach implemented, you can copy from panes in a window as well by zooming into each pane first using Prefix +.



            One important detail that was missing with the mouse mode is to press Shift before selecting an area to copy. This will copy it to traditional terminal buffer instead of the tmux copy buffer. (https://wiki.archlinux.org/index.php/Tmux#Scrolling_issues)






            share|improve this answer


























            • Appreciate your answer. But many a times the referred links may break. It would always be beneficial to add the core part of your answer here and provide the link just for reference.

              – Prasanna
              Mar 31 '16 at 1:14
















            7














            I searched around a lot for this and the best solution for me works as mentioned in this detailed guide:
            http://tangledhelix.com/blog/2012/07/16/tmux-and-mouse-mode/



            Add these bindings in ~/.tmux.conf:



            set -g mode-mouse on

            unbind +
            bind +
            new-window -d -n tmux-zoom 'clear && echo TMUX ZOOM && read' ;
            swap-pane -s tmux-zoom.0 ;
            select-window -t tmux-zoom

            unbind -
            bind -
            last-window ;
            swap-pane -s tmux-zoom.0 ;
            kill-window -t tmux-zoom


            With the above approach implemented, you can copy from panes in a window as well by zooming into each pane first using Prefix +.



            One important detail that was missing with the mouse mode is to press Shift before selecting an area to copy. This will copy it to traditional terminal buffer instead of the tmux copy buffer. (https://wiki.archlinux.org/index.php/Tmux#Scrolling_issues)






            share|improve this answer


























            • Appreciate your answer. But many a times the referred links may break. It would always be beneficial to add the core part of your answer here and provide the link just for reference.

              – Prasanna
              Mar 31 '16 at 1:14














            7












            7








            7







            I searched around a lot for this and the best solution for me works as mentioned in this detailed guide:
            http://tangledhelix.com/blog/2012/07/16/tmux-and-mouse-mode/



            Add these bindings in ~/.tmux.conf:



            set -g mode-mouse on

            unbind +
            bind +
            new-window -d -n tmux-zoom 'clear && echo TMUX ZOOM && read' ;
            swap-pane -s tmux-zoom.0 ;
            select-window -t tmux-zoom

            unbind -
            bind -
            last-window ;
            swap-pane -s tmux-zoom.0 ;
            kill-window -t tmux-zoom


            With the above approach implemented, you can copy from panes in a window as well by zooming into each pane first using Prefix +.



            One important detail that was missing with the mouse mode is to press Shift before selecting an area to copy. This will copy it to traditional terminal buffer instead of the tmux copy buffer. (https://wiki.archlinux.org/index.php/Tmux#Scrolling_issues)






            share|improve this answer















            I searched around a lot for this and the best solution for me works as mentioned in this detailed guide:
            http://tangledhelix.com/blog/2012/07/16/tmux-and-mouse-mode/



            Add these bindings in ~/.tmux.conf:



            set -g mode-mouse on

            unbind +
            bind +
            new-window -d -n tmux-zoom 'clear && echo TMUX ZOOM && read' ;
            swap-pane -s tmux-zoom.0 ;
            select-window -t tmux-zoom

            unbind -
            bind -
            last-window ;
            swap-pane -s tmux-zoom.0 ;
            kill-window -t tmux-zoom


            With the above approach implemented, you can copy from panes in a window as well by zooming into each pane first using Prefix +.



            One important detail that was missing with the mouse mode is to press Shift before selecting an area to copy. This will copy it to traditional terminal buffer instead of the tmux copy buffer. (https://wiki.archlinux.org/index.php/Tmux#Scrolling_issues)







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Mar 31 '16 at 1:34

























            answered Mar 31 '16 at 0:42









            muneebmuneeb

            7614




            7614













            • Appreciate your answer. But many a times the referred links may break. It would always be beneficial to add the core part of your answer here and provide the link just for reference.

              – Prasanna
              Mar 31 '16 at 1:14



















            • Appreciate your answer. But many a times the referred links may break. It would always be beneficial to add the core part of your answer here and provide the link just for reference.

              – Prasanna
              Mar 31 '16 at 1:14

















            Appreciate your answer. But many a times the referred links may break. It would always be beneficial to add the core part of your answer here and provide the link just for reference.

            – Prasanna
            Mar 31 '16 at 1:14





            Appreciate your answer. But many a times the referred links may break. It would always be beneficial to add the core part of your answer here and provide the link just for reference.

            – Prasanna
            Mar 31 '16 at 1:14











            6














            I'd recommend giving a try to the tmux-better-mouse-mode plugin to solve most of your tmux mouse related issues.



            It's compatible with Tmux 2.1+ and the new set-option -g mouse on approach.






            share|improve this answer



















            • 1





              Thanks, this is the best solution for me. It covers all my mouse wheel bindings that I've added manually (so I don't need them anymore), and there are two killer-features that I wanted very much: scroll-without-changing-pane in combination with scroll-without-changing-pane and emulate-scroll-for-no-mouse-alternate-buffer. Now my tmux usage experience is way, way better.

              – selurvedu
              Jun 5 '18 at 11:02


















            6














            I'd recommend giving a try to the tmux-better-mouse-mode plugin to solve most of your tmux mouse related issues.



            It's compatible with Tmux 2.1+ and the new set-option -g mouse on approach.






            share|improve this answer



















            • 1





              Thanks, this is the best solution for me. It covers all my mouse wheel bindings that I've added manually (so I don't need them anymore), and there are two killer-features that I wanted very much: scroll-without-changing-pane in combination with scroll-without-changing-pane and emulate-scroll-for-no-mouse-alternate-buffer. Now my tmux usage experience is way, way better.

              – selurvedu
              Jun 5 '18 at 11:02
















            6












            6








            6







            I'd recommend giving a try to the tmux-better-mouse-mode plugin to solve most of your tmux mouse related issues.



            It's compatible with Tmux 2.1+ and the new set-option -g mouse on approach.






            share|improve this answer













            I'd recommend giving a try to the tmux-better-mouse-mode plugin to solve most of your tmux mouse related issues.



            It's compatible with Tmux 2.1+ and the new set-option -g mouse on approach.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Dec 7 '16 at 16:34









            aymericbeaumetaymericbeaumet

            16113




            16113








            • 1





              Thanks, this is the best solution for me. It covers all my mouse wheel bindings that I've added manually (so I don't need them anymore), and there are two killer-features that I wanted very much: scroll-without-changing-pane in combination with scroll-without-changing-pane and emulate-scroll-for-no-mouse-alternate-buffer. Now my tmux usage experience is way, way better.

              – selurvedu
              Jun 5 '18 at 11:02
















            • 1





              Thanks, this is the best solution for me. It covers all my mouse wheel bindings that I've added manually (so I don't need them anymore), and there are two killer-features that I wanted very much: scroll-without-changing-pane in combination with scroll-without-changing-pane and emulate-scroll-for-no-mouse-alternate-buffer. Now my tmux usage experience is way, way better.

              – selurvedu
              Jun 5 '18 at 11:02










            1




            1





            Thanks, this is the best solution for me. It covers all my mouse wheel bindings that I've added manually (so I don't need them anymore), and there are two killer-features that I wanted very much: scroll-without-changing-pane in combination with scroll-without-changing-pane and emulate-scroll-for-no-mouse-alternate-buffer. Now my tmux usage experience is way, way better.

            – selurvedu
            Jun 5 '18 at 11:02







            Thanks, this is the best solution for me. It covers all my mouse wheel bindings that I've added manually (so I don't need them anymore), and there are two killer-features that I wanted very much: scroll-without-changing-pane in combination with scroll-without-changing-pane and emulate-scroll-for-no-mouse-alternate-buffer. Now my tmux usage experience is way, way better.

            – selurvedu
            Jun 5 '18 at 11:02













            6














            The only thing that works for me is putting the following in ~/.tmux.conf



            # Allow xterm titles in terminal window, terminal scrolling with scrollbar, and setting overrides of C-Up, C-Down, C-Left, C-Right
            set -g terminal-overrides "xterm*:XT:smcup@:rmcup@:kUP5=eOA:kDN5=eOB:kLFT5=eOD:kRIT5=eOC"


            (you may need to reboot for this to take effect)



            Update:



            I found that if you change the setting in Putty Connection > Data > Terminal-type to "putty" (used to fix some formatting issues) from "xterm" then this solution stops working.



            Update 2:



            Use this if you want "putty" as your terminal type: set -g terminal-overrides "putty*:XT:smcup@:rmcup@:kUP5=eOA:kDN5=eOB:kLFT5=eOD:kRIT5=eOC"






            share|improve this answer





















            • 2





              This one actually solves my scrolling problem in iPhone app as well.

              – NathaneilCapital
              Jun 17 '16 at 17:20











            • The latest I tried this wasn't working any more, but this worked. Strange. set -ga terminal-overrides ',xterm*:smcup@:rmcup@'

              – phocks
              Jul 5 '16 at 5:30
















            6














            The only thing that works for me is putting the following in ~/.tmux.conf



            # Allow xterm titles in terminal window, terminal scrolling with scrollbar, and setting overrides of C-Up, C-Down, C-Left, C-Right
            set -g terminal-overrides "xterm*:XT:smcup@:rmcup@:kUP5=eOA:kDN5=eOB:kLFT5=eOD:kRIT5=eOC"


            (you may need to reboot for this to take effect)



            Update:



            I found that if you change the setting in Putty Connection > Data > Terminal-type to "putty" (used to fix some formatting issues) from "xterm" then this solution stops working.



            Update 2:



            Use this if you want "putty" as your terminal type: set -g terminal-overrides "putty*:XT:smcup@:rmcup@:kUP5=eOA:kDN5=eOB:kLFT5=eOD:kRIT5=eOC"






            share|improve this answer





















            • 2





              This one actually solves my scrolling problem in iPhone app as well.

              – NathaneilCapital
              Jun 17 '16 at 17:20











            • The latest I tried this wasn't working any more, but this worked. Strange. set -ga terminal-overrides ',xterm*:smcup@:rmcup@'

              – phocks
              Jul 5 '16 at 5:30














            6












            6








            6







            The only thing that works for me is putting the following in ~/.tmux.conf



            # Allow xterm titles in terminal window, terminal scrolling with scrollbar, and setting overrides of C-Up, C-Down, C-Left, C-Right
            set -g terminal-overrides "xterm*:XT:smcup@:rmcup@:kUP5=eOA:kDN5=eOB:kLFT5=eOD:kRIT5=eOC"


            (you may need to reboot for this to take effect)



            Update:



            I found that if you change the setting in Putty Connection > Data > Terminal-type to "putty" (used to fix some formatting issues) from "xterm" then this solution stops working.



            Update 2:



            Use this if you want "putty" as your terminal type: set -g terminal-overrides "putty*:XT:smcup@:rmcup@:kUP5=eOA:kDN5=eOB:kLFT5=eOD:kRIT5=eOC"






            share|improve this answer















            The only thing that works for me is putting the following in ~/.tmux.conf



            # Allow xterm titles in terminal window, terminal scrolling with scrollbar, and setting overrides of C-Up, C-Down, C-Left, C-Right
            set -g terminal-overrides "xterm*:XT:smcup@:rmcup@:kUP5=eOA:kDN5=eOB:kLFT5=eOD:kRIT5=eOC"


            (you may need to reboot for this to take effect)



            Update:



            I found that if you change the setting in Putty Connection > Data > Terminal-type to "putty" (used to fix some formatting issues) from "xterm" then this solution stops working.



            Update 2:



            Use this if you want "putty" as your terminal type: set -g terminal-overrides "putty*:XT:smcup@:rmcup@:kUP5=eOA:kDN5=eOB:kLFT5=eOD:kRIT5=eOC"







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Oct 28 '17 at 23:37

























            answered Oct 28 '15 at 10:59









            phocksphocks

            19029




            19029








            • 2





              This one actually solves my scrolling problem in iPhone app as well.

              – NathaneilCapital
              Jun 17 '16 at 17:20











            • The latest I tried this wasn't working any more, but this worked. Strange. set -ga terminal-overrides ',xterm*:smcup@:rmcup@'

              – phocks
              Jul 5 '16 at 5:30














            • 2





              This one actually solves my scrolling problem in iPhone app as well.

              – NathaneilCapital
              Jun 17 '16 at 17:20











            • The latest I tried this wasn't working any more, but this worked. Strange. set -ga terminal-overrides ',xterm*:smcup@:rmcup@'

              – phocks
              Jul 5 '16 at 5:30








            2




            2





            This one actually solves my scrolling problem in iPhone app as well.

            – NathaneilCapital
            Jun 17 '16 at 17:20





            This one actually solves my scrolling problem in iPhone app as well.

            – NathaneilCapital
            Jun 17 '16 at 17:20













            The latest I tried this wasn't working any more, but this worked. Strange. set -ga terminal-overrides ',xterm*:smcup@:rmcup@'

            – phocks
            Jul 5 '16 at 5:30





            The latest I tried this wasn't working any more, but this worked. Strange. set -ga terminal-overrides ',xterm*:smcup@:rmcup@'

            – phocks
            Jul 5 '16 at 5:30











            2














            This worked for me:



            vim ~/.tmux.conf
            set -g mode-mouse on ###Insert this setting with vim, then source the file.
            tmux source-file ~/.tmux.conf





            share|improve this answer



















            • 1





              Since the version 2.1 (18 October 2015) the option should be set -g mouse on

              – naoko
              Dec 27 '18 at 0:07
















            2














            This worked for me:



            vim ~/.tmux.conf
            set -g mode-mouse on ###Insert this setting with vim, then source the file.
            tmux source-file ~/.tmux.conf





            share|improve this answer



















            • 1





              Since the version 2.1 (18 October 2015) the option should be set -g mouse on

              – naoko
              Dec 27 '18 at 0:07














            2












            2








            2







            This worked for me:



            vim ~/.tmux.conf
            set -g mode-mouse on ###Insert this setting with vim, then source the file.
            tmux source-file ~/.tmux.conf





            share|improve this answer













            This worked for me:



            vim ~/.tmux.conf
            set -g mode-mouse on ###Insert this setting with vim, then source the file.
            tmux source-file ~/.tmux.conf






            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Jan 4 '17 at 20:22









            ChhetriChhetri

            211




            211








            • 1





              Since the version 2.1 (18 October 2015) the option should be set -g mouse on

              – naoko
              Dec 27 '18 at 0:07














            • 1





              Since the version 2.1 (18 October 2015) the option should be set -g mouse on

              – naoko
              Dec 27 '18 at 0:07








            1




            1





            Since the version 2.1 (18 October 2015) the option should be set -g mouse on

            – naoko
            Dec 27 '18 at 0:07





            Since the version 2.1 (18 October 2015) the option should be set -g mouse on

            – naoko
            Dec 27 '18 at 0:07











            0














            The only thing that worked for me was
            vim ~/.tmux.conf
            set -g mode-mouse on ###Insert this setting with vim, then source the file.
            tmux source-file ~/.tmux.conf






            share|improve this answer








            New contributor




            Sarika Soni is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.





















            • Could you use some formatting to make this more clear? Use the EDIT button and then look at the options available in the editor to add the helpful formats.

              – music2myear
              10 hours ago
















            0














            The only thing that worked for me was
            vim ~/.tmux.conf
            set -g mode-mouse on ###Insert this setting with vim, then source the file.
            tmux source-file ~/.tmux.conf






            share|improve this answer








            New contributor




            Sarika Soni is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.





















            • Could you use some formatting to make this more clear? Use the EDIT button and then look at the options available in the editor to add the helpful formats.

              – music2myear
              10 hours ago














            0












            0








            0







            The only thing that worked for me was
            vim ~/.tmux.conf
            set -g mode-mouse on ###Insert this setting with vim, then source the file.
            tmux source-file ~/.tmux.conf






            share|improve this answer








            New contributor




            Sarika Soni is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.










            The only thing that worked for me was
            vim ~/.tmux.conf
            set -g mode-mouse on ###Insert this setting with vim, then source the file.
            tmux source-file ~/.tmux.conf







            share|improve this answer








            New contributor




            Sarika Soni is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.









            share|improve this answer



            share|improve this answer






            New contributor




            Sarika Soni is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.









            answered 10 hours ago









            Sarika SoniSarika Soni

            1




            1




            New contributor




            Sarika Soni is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.





            New contributor





            Sarika Soni is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.






            Sarika Soni is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.













            • Could you use some formatting to make this more clear? Use the EDIT button and then look at the options available in the editor to add the helpful formats.

              – music2myear
              10 hours ago



















            • Could you use some formatting to make this more clear? Use the EDIT button and then look at the options available in the editor to add the helpful formats.

              – music2myear
              10 hours ago

















            Could you use some formatting to make this more clear? Use the EDIT button and then look at the options available in the editor to add the helpful formats.

            – music2myear
            10 hours ago





            Could you use some formatting to make this more clear? Use the EDIT button and then look at the options available in the editor to add the helpful formats.

            – music2myear
            10 hours ago











            -1
















            • Ctrl + A - to start scrolling


            • Ctrl + C - to stop scrolling






            share|improve this answer





















            • 2





              This post is too short to be usefully answer the question. It adds very little new information to answers already posted; it says nothing about how to scroll (only how to change in and out of copy mode). Also, the default command prefix key combination is Ctrl-B (Ctrl-Ais the default for GNU screen).

              – Anthony Geoghegan
              Oct 26 '16 at 8:50













            • Not sure if the author of this answer even understood the question. It's unhelpful and just wrong.

              – Vik
              Mar 30 '17 at 7:53






            • 1





              I've been looking for how to stop scrolling for so long, thanks for pointing it out!

              – PERR0_HUNTER
              Apr 9 '17 at 17:12
















            -1
















            • Ctrl + A - to start scrolling


            • Ctrl + C - to stop scrolling






            share|improve this answer





















            • 2





              This post is too short to be usefully answer the question. It adds very little new information to answers already posted; it says nothing about how to scroll (only how to change in and out of copy mode). Also, the default command prefix key combination is Ctrl-B (Ctrl-Ais the default for GNU screen).

              – Anthony Geoghegan
              Oct 26 '16 at 8:50













            • Not sure if the author of this answer even understood the question. It's unhelpful and just wrong.

              – Vik
              Mar 30 '17 at 7:53






            • 1





              I've been looking for how to stop scrolling for so long, thanks for pointing it out!

              – PERR0_HUNTER
              Apr 9 '17 at 17:12














            -1












            -1








            -1









            • Ctrl + A - to start scrolling


            • Ctrl + C - to stop scrolling






            share|improve this answer

















            • Ctrl + A - to start scrolling


            • Ctrl + C - to stop scrolling







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Oct 26 '16 at 14:52









            3498DB

            15.9k114862




            15.9k114862










            answered Oct 26 '16 at 7:55









            user656723user656723

            19




            19








            • 2





              This post is too short to be usefully answer the question. It adds very little new information to answers already posted; it says nothing about how to scroll (only how to change in and out of copy mode). Also, the default command prefix key combination is Ctrl-B (Ctrl-Ais the default for GNU screen).

              – Anthony Geoghegan
              Oct 26 '16 at 8:50













            • Not sure if the author of this answer even understood the question. It's unhelpful and just wrong.

              – Vik
              Mar 30 '17 at 7:53






            • 1





              I've been looking for how to stop scrolling for so long, thanks for pointing it out!

              – PERR0_HUNTER
              Apr 9 '17 at 17:12














            • 2





              This post is too short to be usefully answer the question. It adds very little new information to answers already posted; it says nothing about how to scroll (only how to change in and out of copy mode). Also, the default command prefix key combination is Ctrl-B (Ctrl-Ais the default for GNU screen).

              – Anthony Geoghegan
              Oct 26 '16 at 8:50













            • Not sure if the author of this answer even understood the question. It's unhelpful and just wrong.

              – Vik
              Mar 30 '17 at 7:53






            • 1





              I've been looking for how to stop scrolling for so long, thanks for pointing it out!

              – PERR0_HUNTER
              Apr 9 '17 at 17:12








            2




            2





            This post is too short to be usefully answer the question. It adds very little new information to answers already posted; it says nothing about how to scroll (only how to change in and out of copy mode). Also, the default command prefix key combination is Ctrl-B (Ctrl-Ais the default for GNU screen).

            – Anthony Geoghegan
            Oct 26 '16 at 8:50







            This post is too short to be usefully answer the question. It adds very little new information to answers already posted; it says nothing about how to scroll (only how to change in and out of copy mode). Also, the default command prefix key combination is Ctrl-B (Ctrl-Ais the default for GNU screen).

            – Anthony Geoghegan
            Oct 26 '16 at 8:50















            Not sure if the author of this answer even understood the question. It's unhelpful and just wrong.

            – Vik
            Mar 30 '17 at 7:53





            Not sure if the author of this answer even understood the question. It's unhelpful and just wrong.

            – Vik
            Mar 30 '17 at 7:53




            1




            1





            I've been looking for how to stop scrolling for so long, thanks for pointing it out!

            – PERR0_HUNTER
            Apr 9 '17 at 17:12





            I've been looking for how to stop scrolling for so long, thanks for pointing it out!

            – PERR0_HUNTER
            Apr 9 '17 at 17:12


















            draft saved

            draft discarded




















































            Thanks for contributing an answer to Super User!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f209437%2fhow-do-i-scroll-in-tmux%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Couldn't open a raw socket. Error: Permission denied (13) (nmap)Is it possible to run networking commands...

            VNC viewer RFB protocol error: bad desktop size 0x0I Cannot Type the Key 'd' (lowercase) in VNC Viewer...

            Why not use the yoke to control yaw, as well as pitch and roll? Announcing the arrival of...