Check if auto-save interpolation present before adding it

This commit is contained in:
Bruno Sutic 2015-02-20 02:06:24 +01:00
parent fb641881c2
commit c720876da0
No known key found for this signature in database
GPG Key ID: 66D96E4F2F7EF26C

View File

@ -34,8 +34,11 @@ delay_saving_environment_on_first_plugin_load() {
add_resurrect_save_interpolation() {
local status_right_value="$(get_tmux_option "status-right" "")"
local new_value="${save_command_interpolation}${status_right_value}"
set_tmux_option "status-right" "$new_value"
# check interpolation not already added
if ! [[ "$status_right_value" == *"$save_command_interpolation"* ]]; then
local new_value="${save_command_interpolation}${status_right_value}"
set_tmux_option "status-right" "$new_value"
fi
}
# on tmux server start, when tmux.conf is sourced there are no sessions and