From c720876da0bd24e396b8869e27a94553db06503e Mon Sep 17 00:00:00 2001 From: Bruno Sutic Date: Fri, 20 Feb 2015 02:06:24 +0100 Subject: [PATCH] Check if auto-save interpolation present before adding it --- resurrect_auto.tmux | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/resurrect_auto.tmux b/resurrect_auto.tmux index 1535bff..333e038 100755 --- a/resurrect_auto.tmux +++ b/resurrect_auto.tmux @@ -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