Skip to content

Instantly share code, notes, and snippets.

@T1T4N
Last active January 10, 2018 07:51
Show Gist options
  • Save T1T4N/599e49ef27014655599d0bbddc7948ba to your computer and use it in GitHub Desktop.
Save T1T4N/599e49ef27014655599d0bbddc7948ba to your computer and use it in GitHub Desktop.
tmux 2.5 emulate scrolling by sending up/down keys for specified commands
# Emulate scrolling by sending up and down keys if these commands are running in the pane
tmux_commands_with_legacy_scroll="'nano less more man'"
bind -n WheelUpPane if "[[ #{tmux_commands_with_legacy_scroll} =~ #{pane_current_command} ]]" "select-pane -t = ; send-keys Up" 'if-shell -F -t = "#{mouse_any_flag} || #{pane_in_mode}" "send-keys -M" "copy-mode -et="'
bind -n WheelDownPane if "[[ #{tmux_commands_with_legacy_scroll} =~ #{pane_current_command} ]]" "select-pane -t = ; send-keys Down" 'if-shell -F -t = "#{mouse_any_flag} || #{pane_in_mode}" "send-keys -M" "copy-mode -et="'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment