From 20d326fd4538610ad4edee82c144859695c8897d Mon Sep 17 00:00:00 2001 From: Austin Beam Date: Sat, 3 May 2014 17:58:43 -0500 Subject: [PATCH] tmux: Check version for last window indication Last active window indication feature introduced by pull request #864 causes undesired behavior on older versions of tmux. Add version checking to determine which method for feature implementation to use, dropping the feature entirely for tmux versions less that v1.8. For tmux v1.9, use the newer 'window-status-last-style' option rather than the deprecated (starting with v1.9) 'window-status-last-fg' option. Ideally, the other `foo-{attr,fg,bg}` options used in the `tmux` powerline config file should also be version checked and replaced with the corresponding `foo-style` option as well. --- powerline/bindings/tmux/powerline.conf | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/powerline/bindings/tmux/powerline.conf b/powerline/bindings/tmux/powerline.conf index 16204739..6facec9c 100644 --- a/powerline/bindings/tmux/powerline.conf +++ b/powerline/bindings/tmux/powerline.conf @@ -15,7 +15,10 @@ set -g status-right '#(eval $POWERLINE_COMMAND tmux right -R pane_id=`tmux displ set -g status-right-length 150 set -g window-status-format "#[fg=colour244,bg=colour234]#I #[fg=colour240] #[default]#W " set -g window-status-current-format "#[fg=colour234,bg=colour31]#[fg=colour117,bg=colour31] #I  #[fg=colour231,bold]#W #[fg=colour31,bg=colour234,nobold]" -set -g window-status-last-fg colour31 +# Version check for window-status-last-style and/or window-status-last-fg functionality +if-shell '[ $TMUX_VERSION_MAJOR -gt 1 -o \( $TMUX_VERSION_MAJOR -eq 1 -a $TMUX_VERSION_MINOR -ge 9 \) ]' \ + "set -g window-status-last-style fg=colour31" \ + 'if-shell "[ $TMUX_VERSION_MAJOR -eq 1 -a $TMUX_VERSION_MINOR -ge 8 ]" "set -g window-status-last-fg colour31"' set-window-option -g window-status-fg colour249 set-window-option -g window-status-activity-attr none set-window-option -g window-status-bell-attr none