Skip to content

Instantly share code, notes, and snippets.

@sailfish009
Last active November 29, 2020 14:01
Show Gist options
  • Save sailfish009/3b30caa5c594e32d760c4ad37d8bd2c2 to your computer and use it in GitHub Desktop.
Save sailfish009/3b30caa5c594e32d760c4ad37d8bd2c2 to your computer and use it in GitHub Desktop.
tmux with mouse scroll (for v2.x)
# Make mouse useful in copy mode
setw -g mouse on
# make scrolling with wheels work
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'select-pane -t=; copy-mode -e; send-keys -M'"
bind -n WheelDownPane select-pane -t= \; send-keys -M
# 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment