76

I've seen elsewhere that scrolling via the mouse wheel (and other mousy events) can be enabled for tmux.. can this feature also be enabled in byobu (over tmux) and how?

Ashimema
  • 1,965
  • 3
  • 19
  • 19

4 Answers4

73

If you still have this problem,

Try ALT + F12

In my case, this enables mouse scrolling on byobu

RNA
  • 1,451
  • 2
  • 16
  • 24
  • 1
    It can help the poster if you indicate where you found this shortcut – Charles Green Jun 30 '14 at 05:48
  • There's Help menu in configuration. You can find it by running byobu-config on the terminal or simply press Shift+F1 – RNA Jul 01 '14 at 01:52
  • 6
    It's interesting that turning mouse support _off_ causes the scrolling to work. Anyone why that is? edit: And I see that this stops me from selecting text with my mouse... :( – alecbz Nov 11 '14 at 23:05
  • 1
    @alecb, it seems that when in the "mouse off" mode, you can still select text with the mouse by holding shift. edit: oh, just noticed that this is also mentioned in EvanLanglois's answer – yoniLavi Apr 24 '15 at 11:51
40

Yes, this is possible. You just have to enter scrollback mode first.

Simply press F7, and then use your mouse scroll wheel. Finally, press ESC to exit scrollback mode.

It appears that some terminals won't allow you to scroll using your mouse still. For Gnome Terminal, untick the Scroll on keystroke option in the profile preferences (tab Scrolling).

gertvdijk
  • 67,007
  • 33
  • 188
  • 283
Dustin Kirkland
  • 14,458
  • 3
  • 69
  • 93
  • 11
    Hmm, that doesn't seem to work for me. Instead I get the whole terminal scrolling, making the byobu session disappear off the screen? Am I missing some additional setting somewhere? (Using gnome-terminal to ssh into server where byobu session is running) – Ashimema Oct 17 '12 at 09:16
  • 4
    What if you press alt-pageup, and then try using the scroll wheel...does that work? – Dustin Kirkland Oct 22 '12 at 14:38
  • 2
    Confirmed working with Konsole. Confirmed ineffective in Gnome Terminal by default - had to untick `Scroll on keystroke` option in profile preferences. – gertvdijk Jan 05 '13 at 21:21
  • @DustinKirkland sorry to revive this old thread, but I am still not able to scroll with the mouse.. I have disabled Scroll on Keystroke, and pressing alt-pageup is not doing anything.. I am testing this on mints Mate terminal (which should be reasonably similar to gnome terminal from GTK2) – Karthik T Aug 03 '13 at 03:16
  • 6
    @DustinKirkland also I notice that I need to press *Enter* to exit the mode, not Esc as you indicate. Has this changed recently perhaps? – Karthik T Aug 03 '13 at 03:17
  • can we save scrool back session in any text file rather than doing copy/paste? – Sukupa91 Nov 27 '13 at 03:15
  • That's a separate question, Sushantp606. But the answer is "yes". Shift-F9 (or Shift-F7) in the latest Byobu release, 5.66). – Dustin Kirkland Nov 27 '13 at 14:56
  • I needed the gnome terminal workaround as suggested by gertvdijk. Marked as solved now the answer has been edited. – Ashimema Jan 14 '14 at 07:37
  • 5
    FYI, this does not work for me in gnome-terminal, even after disabling "Scroll on keystroke". – alecbz Nov 11 '14 at 23:14
  • 1
    @DustinKirkland I wasn't able to exit scrollback mode with ESC either, only with Enter. Could you edit your answer to include this info? – nick Jul 31 '15 at 23:01
  • has anyone been able to enable mouse scroll back in iTerm2? – waspinator Dec 03 '16 at 17:03
  • Doesnt seem to work with iTerm2 and Magic Touchpad – Thamme Gowda Jul 20 '17 at 18:13
  • 1
    Pressing F7 and scrolling does not work. Also when unticking "scroll on keystroke". This is on 18.10 with Gnome Terminal. Using mouse mode with Alt-F12 works, as suggested in the other answer. I'd appreciate if this answer was updated to be a little more comprehensive. – slhck Jan 09 '19 at 14:03
  • 1
    Alt+pageup and down is what worked for me on ubuntu 18 + gnome-terminal – hbobenicio Jun 15 '20 at 12:04
14

Add below options to ~/.byobu/.tmux.conf:

set -g mouse on

detail here

ostergaard
  • 278
  • 2
  • 6
7

If you just want scrollback and you don't want to engage the tmux "mouse-mode" (which will interfere with your ability to cut-n-paste with the mouse) just add the following to $HOME/.byobu/.tmux.conf

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

Now your terminal's scrollback works normally and you don't need to hit any special keys to engage the mouse. The drawback is that the terminal only knows about a single screen. You'll still need to use "mouse mouse" to scroll a screen other than the most recent (such as to get to a long-scrolling log buffer), but if you just want to scroll up to see what just scrolled off your screen, this will fix it! It doesn't know about split screens either. BTW, the "mouse mode" can be set automatically in your config files. You paste with your command key (usually Ctrl-A) followed by the ] key. The mouse selection is cut automatically in mouse mode, but you'll have to get out of mouse mode or hold down Shift to get the usual clipboard behavior that allows you to paste into another GUI app.

Recommendation: Since byobu already uses multiple terminal sessions inside itself, you don't need to use it with multiple terminals. So, instead of having a hot-key that opens a new terminal, I assign my "open terminal" hot-key to tilda. Tilda drops-down from whatever workspace you are currently using (shows on all workspaces) and it stays running so it is always available. This works nicely with byobu because I now have 1 place for all my shell sessions (you can set tilda to run byobu instead of a normal shell and re-run it if you accidently exit your shell). Further, your terminal sessions out-last your GUI because you are using byobu. I log into my system with ssh and automatically get my byobu session (great to monitor compiles, etc) and the byobu virtual window resizes to my cell phone screen. When I reorient the phone, the byobu window on my desktop screen changes with the phone orientation - MAGIC! Very impressive to Windows users.

Next is to use enlightenment's terminal hacks to get a notification (from the GUI) when a terminal job finishes, but dbus permissions makes that iffy. If anyone gets this working with byobu please let me know!

Pablo Bianchi
  • 14,308
  • 4
  • 74
  • 117
Evan Langlois
  • 198
  • 1
  • 6
  • 1
    Strange thing happened. Adding the line you told me to made it work fine on the first day but then I couldn't scroll on Byobu at all. With the mouse wheel or using Alt + PageUp. Do you know what happened? – azizbro Mar 17 '20 at 23:24