Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Tmux configuration to enable mouse scroll and mouse panel select, taken from: http://brainscraps.wikia.com/wiki/Extreme_Multitasking_with_tmux_and_PuTTY
# Make mouse useful in copy mode
setw -g mode-mouse on
# Allow mouse to select which pane to use
set -g mouse-select-pane on
# Allow mouse dragging to resize panes
set -g mouse-resize-pane on
# Allow mouse to select windows
set -g mouse-select-window on
# Allow xterm titles in terminal window, terminal scrolling with scrollbar, and setting overrides of C-Up, C-Down, C-Left, C-Right
# (commented out because it disables cursor navigation in vim)
#set -g terminal-overrides "xterm*:XT:smcup@:rmcup@:kUP5=\eOA:kDN5=\eOB:kLFT5=\eOD:kRIT5=\eOC"
# Scroll History
set -g history-limit 30000
# Set ability to capture on start and restore on exit window data when running an application
setw -g alternate-screen on
# Lower escape timing from 500ms to 50ms for quicker response to scroll-buffer access.
set -s escape-time 50
Terminal -> Bell -> Action to happen when a bell occurs = None (bell disabled)
Window -> Lines of Scrollback = 1000 (For the quick "Oops, what did I do" moment)
Window -> Reset scrollback on keypress = check
Window -> Reset scrollback on display activity = uncheck
SSH -> Remote command = tmux a -t base || tmux new -s base (if you're going to use this connection for tmux)
SSH -> Protocol = 2 only
SSH -> Auth -> Attempt authentication using Pageant = check (Most Important One)
SSH -> Auth -> Private key file for authentication = c:\full\path\to\rsa.ppk
SSH -> X11 -> Enable X11 forwarding = check (Important if you use X11 applications that need to display to your laptop.)
(copy/paste with mouse in putty should be done holding shift key)
@Relequestual

This comment has been minimized.

Copy link

@Relequestual Relequestual commented Mar 2, 2017

Anyone else arriving here like me, wondering why mouse-mode doesn't work...

In Configurations Options. Tmux 2.1 dont support

setw -g mode-mouse off
set -g mouse-select-pane off
set -g mouse-resize-pane off
set -g mouse-select-window off

instead use:

*set -g mouse on

https://gist.github.com/MohamedAlaa/2961058#gistcomment-1611930

@Rushi98

This comment has been minimized.

Copy link

@Rushi98 Rushi98 commented Dec 1, 2017

@Relequestual Thanks 👍

@brando90

This comment has been minimized.

Copy link

@brando90 brando90 commented Mar 7, 2018

is there a way so that when I am selecting stuff with the mouse it doesn't select things from other panes too?

@peturingi

This comment has been minimized.

Copy link

@peturingi peturingi commented Mar 29, 2018

@Relequestual Thank you :)

@mattcodez

This comment has been minimized.

Copy link

@mattcodez mattcodez commented Apr 2, 2018

@brando90 Last I saw, you need to go full screen with the given pane (ctrl+b z) then copy and go back.

@yanadam

This comment has been minimized.

Copy link

@yanadam yanadam commented May 30, 2018

@brando90 In putty, if you hold ALT down, you "column select" (or block select). So in this instance, if you hold SHIFT+ALT, you can select a block only in the pane you want...

@hanxi

This comment has been minimized.

Copy link

@hanxi hanxi commented Nov 2, 2018

Thanks!

@LyleLee

This comment has been minimized.

Copy link

@LyleLee LyleLee commented Sep 2, 2019

Thanks a lot! This is the best configuration I can find to make mouse work on tmux so awsome.

@philophilo

This comment has been minimized.

Copy link

@philophilo philophilo commented Apr 9, 2020

Best config, thanks @Relequestual

@sycophant-stone

This comment has been minimized.

Copy link

@sycophant-stone sycophant-stone commented Apr 21, 2020

Pretty awesome man.
successful at tmux 1.8 version.

@dcts

This comment has been minimized.

Copy link

@dcts dcts commented Feb 16, 2021

awesome thanks @Relequestual

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment