diff --git a/.config/tmux/tmux.conf b/.config/tmux/tmux.conf index 3fe0c74..d9fdc25 100644 --- a/.config/tmux/tmux.conf +++ b/.config/tmux/tmux.conf @@ -3,7 +3,9 @@ set -g mouse on set -g mode-keys vi set -g extended-keys always -set -g prompt-history-limit 999999 +if -F "#{>=:#{version},3.3}" { + set -g prompt-history-limit 999999 +} set -g history-file "$XDG_DATA_HOME/tmux/tmux_history" run-shell 'mkdir -p "${XDG_DATA_HOME:-$HOME/.local/share}/tmux"' @@ -168,11 +170,14 @@ bind -r P swap-window -d -t :-1 bind -n MouseDrag1Status swap-window -d -t= # TODO: do nothing on drags that don't start on a window name -bind -n MouseDragEnd1StatusDefault { - if -F "#{e|>|f|0:#{mouse_x},#{e|/|f:#{window_width},2}}" { - run-shell "tmux move-window -at #{last_window_index}" - } { - move-window -t0 +# NOTE: mouse_{x,y} were not set in status line before 3.3 +if -F "#{>=:#{version},3.3}" { + bind -n MouseDragEnd1StatusDefault { + if -F "#{e|>|f|0:#{mouse_x},#{e|/|f:#{window_width},2}}" { + run-shell "tmux move-window -at #{last_window_index}" + } { + move-window -t0 + } } } @@ -327,8 +332,14 @@ bind S set -w synchronize-panes # Require confirmation before killing a pane set -g remain-on-exit on -bind -n C-d if -F "#{pane_dead}" { kill-pane } { send } -bind -n Enter if -F "#{pane_dead}" { respawn-pane } { send } +if -F "#{>=:#{version},3.3}" { + bind -n C-d if -F "#{pane_dead}" { kill-pane } { send } + bind -n Enter if -F "#{pane_dead}" { respawn-pane } { send } +} { + # omitting the key argument was introduced in 3.3 + bind -n C-d if -F "#{pane_dead}" { kill-pane } { send C-d } + bind -n Enter if -F "#{pane_dead}" { respawn-pane } { send Enter } +} # Change installation location of plugins setenv -g TMUX_PLUGIN_MANAGER_PATH "$XDG_CONFIG_HOME/tmux/plugins/"