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.
This commit is contained in:
Austin Beam 2014-05-03 17:58:43 -05:00
parent 478e49773b
commit 20d326fd45

View File

@ -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