Skip to content

Commit

Permalink
fix: status bar item duplication on conf reload
Browse files Browse the repository at this point in the history
This fixes a weird behavior where a custom status bar item (e.g. a prefix) would
be duplicated in the status bar after a configuration reload.

e.g. prior to this fix, setting:

  set -g @theme-status-left-prefix "test"

and reloading the configuration multiple times would result in multiple 'test'
strings being added as prefix.

Fixes jimeh#54
  • Loading branch information
aleeraser committed Dec 18, 2023
1 parent 7c59902 commit c7ab152
Show file tree
Hide file tree
Showing 27 changed files with 216 additions and 216 deletions.
16 changes: 8 additions & 8 deletions basic.tmuxtheme
Original file line number Diff line number Diff line change
Expand Up @@ -59,20 +59,20 @@ set -goq @theme-status-bg black
set -goq @theme-status-fg cyan
set -goq @theme-status-interval 1
set -goq @theme-status-justify centre
set -goqF @theme-status-left "#{@themepack-status-left-area-left-format} #[fg=white]» #[fg=yellow]#{@themepack-status-left-area-middle-format} #[fg=cyan]#{@themepack-status-left-area-right-format}"
set -goqF @theme-status-left-custom "#{@themepack-status-left-area-left-format} #[fg=white]» #[fg=yellow]#{@themepack-status-left-area-middle-format} #[fg=cyan]#{@themepack-status-left-area-right-format}"
set -goq @theme-status-left-bg black
set -goq @theme-status-left-fg green
set -goq @theme-status-left-length 40
set -goqF @theme-status-right "#{@themepack-status-right-area-left-format} #[fg=white]« #[fg=yellow]#{@themepack-status-right-area-middle-format} #[fg=green]#{@themepack-status-right-area-right-format}"
set -goqF @theme-status-right-custom "#{@themepack-status-right-area-left-format} #[fg=white]« #[fg=yellow]#{@themepack-status-right-area-middle-format} #[fg=green]#{@themepack-status-right-area-right-format}"
set -goq @theme-status-right-bg black
set -goq @theme-status-right-fg cyan
set -goq @theme-status-right-length 40
set -goq @theme-window-status-activity-bg black
set -goq @theme-window-status-activity-fg yellow
set -goq @theme-window-status-current-bg red
set -goq @theme-window-status-current-fg black
set -goqF @theme-window-status-current-format " #{@themepack-window-status-current-format} "
set -goqF @theme-window-status-format " #{@themepack-window-status-format} "
set -goqF @theme-window-status-current-format-custom " #{@themepack-window-status-current-format} "
set -goqF @theme-window-status-format-custom " #{@themepack-window-status-format} "
set -goq @theme-window-status-separator ""

# Customizable prefixes and suffixes for @theme-* format options
Expand All @@ -86,10 +86,10 @@ set -goq @theme-window-status-prefix ""
set -goq @theme-window-status-suffix ""

# Apply prefixes and suffixes to @theme-* format options
set -gqF @theme-status-left "#{@theme-status-left-prefix}#{@theme-status-left}#{@theme-status-left-suffix}"
set -gqF @theme-status-right "#{@theme-status-right-prefix}#{@theme-status-right}#{@theme-status-right-suffix}"
set -gqF @theme-window-status-current-format "#{@theme-window-status-current-prefix}#{@theme-window-status-current-format}#{@theme-window-status-current-suffix}"
set -gqF @theme-window-status-format "#{@theme-window-status-prefix}#{@theme-window-status-format}#{@theme-window-status-suffix}"
set -gqF @theme-status-left "#{@theme-status-left-prefix}#{@theme-status-left-custom}#{@theme-status-left-suffix}"
set -gqF @theme-status-right "#{@theme-status-right-prefix}#{@theme-status-right-custom}#{@theme-status-right-suffix}"
set -gqF @theme-window-status-current-format "#{@theme-window-status-current-prefix}#{@theme-window-status-current-format-custom}#{@theme-window-status-current-suffix}"
set -gqF @theme-window-status-format "#{@theme-window-status-prefix}#{@theme-window-status-format-custom}#{@theme-window-status-suffix}"

# Apply @theme-* options to Tmux
set -gF display-panes-active-colour "#{@theme-display-panes-active-colour}"
Expand Down
16 changes: 8 additions & 8 deletions powerline/block/blue.tmuxtheme
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,11 @@ set -goqF @theme-status-bg "#{@powerline-status-bg}"
set -goqF @theme-status-fg "#{@powerline-status-fg}"
set -goq @theme-status-interval 1
set -goq @theme-status-justify centre
set -goqF @theme-status-left "#[fg=#{@powerline-status-left-area-left-fg},bg=#{@powerline-status-left-area-left-bg},bold] #{@themepack-status-left-area-left-format} #[fg=#{@powerline-status-left-area-left-bg},bg=#{@powerline-status-left-area-middle-bg},nobold]#[fg=#{@powerline-status-left-area-middle-fg},bg=#{@powerline-status-left-area-middle-bg}] #{@themepack-status-left-area-middle-format} #[fg=#{@powerline-status-left-area-middle-bg},bg=#{@powerline-status-left-area-right-bg}]#[fg=#{@powerline-status-left-area-right-fg},bg=#{@powerline-status-left-area-right-bg}] #{@themepack-status-left-area-right-format} #[fg=#{@powerline-status-left-area-right-bg},bg=#{@theme-status-bg},nobold]"
set -goqF @theme-status-left-custom "#[fg=#{@powerline-status-left-area-left-fg},bg=#{@powerline-status-left-area-left-bg},bold] #{@themepack-status-left-area-left-format} #[fg=#{@powerline-status-left-area-left-bg},bg=#{@powerline-status-left-area-middle-bg},nobold]#[fg=#{@powerline-status-left-area-middle-fg},bg=#{@powerline-status-left-area-middle-bg}] #{@themepack-status-left-area-middle-format} #[fg=#{@powerline-status-left-area-middle-bg},bg=#{@powerline-status-left-area-right-bg}]#[fg=#{@powerline-status-left-area-right-fg},bg=#{@powerline-status-left-area-right-bg}] #{@themepack-status-left-area-right-format} #[fg=#{@powerline-status-left-area-right-bg},bg=#{@theme-status-bg},nobold]"
set -goqF @theme-status-left-bg "#{@powerline-status-left-bg}"
set -goqF @theme-status-left-fg "#{@powerline-status-left-fg}"
set -goq @theme-status-left-length 40
set -goqF @theme-status-right "#[fg=#{@powerline-status-right-area-left-bg},bg=#{@theme-status-bg}]#[fg=#{@powerline-status-right-area-left-fg},bg=#{@powerline-status-right-area-left-bg}] #{@themepack-status-right-area-left-format} #[fg=#{@powerline-status-right-area-middle-bg},bg=#{@powerline-status-right-area-left-bg}]#[fg=#{@powerline-status-right-area-middle-fg},bg=#{@powerline-status-right-area-middle-bg}] #{@themepack-status-right-area-middle-format} #[fg=#{@powerline-status-right-area-right-bg},bg=#{@powerline-status-right-area-middle-bg}]#[fg=#{@powerline-status-right-area-right-fg},bg=#{@powerline-status-right-area-right-bg},bold] #{@themepack-status-right-area-right-format} "
set -goqF @theme-status-right-custom "#[fg=#{@powerline-status-right-area-left-bg},bg=#{@theme-status-bg}]#[fg=#{@powerline-status-right-area-left-fg},bg=#{@powerline-status-right-area-left-bg}] #{@themepack-status-right-area-left-format} #[fg=#{@powerline-status-right-area-middle-bg},bg=#{@powerline-status-right-area-left-bg}]#[fg=#{@powerline-status-right-area-middle-fg},bg=#{@powerline-status-right-area-middle-bg}] #{@themepack-status-right-area-middle-format} #[fg=#{@powerline-status-right-area-right-bg},bg=#{@powerline-status-right-area-middle-bg}]#[fg=#{@powerline-status-right-area-right-fg},bg=#{@powerline-status-right-area-right-bg},bold] #{@themepack-status-right-area-right-format} "
set -goqF @theme-status-right-bg "#{@powerline-status-right-bg}"
set -goqF @theme-status-right-fg "#{@powerline-status-right-fg}"
set -goq @theme-status-right-length 150
Expand All @@ -114,8 +114,8 @@ set -goqF @theme-window-status-activity-fg "#{@powerline-color-activity-1}"
set -goq @theme-window-status-separator ""
set -goqF @theme-window-status-current-bg "#{@powerline-color-main-1}"
set -goqF @theme-window-status-current-fg "#{@powerline-color-black-1}"
set -goqF @theme-window-status-format " #{@themepack-window-status-format} "
set -goqF @theme-window-status-current-format " #{@themepack-window-status-current-format} "
set -goqF @theme-window-status-format-custom " #{@themepack-window-status-format} "
set -goqF @theme-window-status-current-format-custom " #{@themepack-window-status-current-format} "

# Customizable prefixes and suffixes for @theme-* format options
set -goq @theme-status-left-prefix ""
Expand All @@ -128,10 +128,10 @@ set -goq @theme-window-status-prefix ""
set -goq @theme-window-status-suffix ""

# Apply prefixes and suffixes to @theme-* format options
set -gqF @theme-status-left "#{@theme-status-left-prefix}#{@theme-status-left}#{@theme-status-left-suffix}"
set -gqF @theme-status-right "#{@theme-status-right-prefix}#{@theme-status-right}#{@theme-status-right-suffix}"
set -gqF @theme-window-status-current-format "#{@theme-window-status-current-prefix}#{@theme-window-status-current-format}#{@theme-window-status-current-suffix}"
set -gqF @theme-window-status-format "#{@theme-window-status-prefix}#{@theme-window-status-format}#{@theme-window-status-suffix}"
set -gqF @theme-status-left "#{@theme-status-left-prefix}#{@theme-status-left-custom}#{@theme-status-left-suffix}"
set -gqF @theme-status-right "#{@theme-status-right-prefix}#{@theme-status-right-custom}#{@theme-status-right-suffix}"
set -gqF @theme-window-status-current-format "#{@theme-window-status-current-prefix}#{@theme-window-status-current-format-custom}#{@theme-window-status-current-suffix}"
set -gqF @theme-window-status-format "#{@theme-window-status-prefix}#{@theme-window-status-format-custom}#{@theme-window-status-suffix}"

# Apply @theme-* options to Tmux
set -gF display-panes-active-colour "#{@theme-display-panes-active-colour}"
Expand Down
16 changes: 8 additions & 8 deletions powerline/block/cyan.tmuxtheme
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,11 @@ set -goqF @theme-status-bg "#{@powerline-status-bg}"
set -goqF @theme-status-fg "#{@powerline-status-fg}"
set -goq @theme-status-interval 1
set -goq @theme-status-justify centre
set -goqF @theme-status-left "#[fg=#{@powerline-status-left-area-left-fg},bg=#{@powerline-status-left-area-left-bg},bold] #{@themepack-status-left-area-left-format} #[fg=#{@powerline-status-left-area-left-bg},bg=#{@powerline-status-left-area-middle-bg},nobold]#[fg=#{@powerline-status-left-area-middle-fg},bg=#{@powerline-status-left-area-middle-bg}] #{@themepack-status-left-area-middle-format} #[fg=#{@powerline-status-left-area-middle-bg},bg=#{@powerline-status-left-area-right-bg}]#[fg=#{@powerline-status-left-area-right-fg},bg=#{@powerline-status-left-area-right-bg}] #{@themepack-status-left-area-right-format} #[fg=#{@powerline-status-left-area-right-bg},bg=#{@theme-status-bg},nobold]"
set -goqF @theme-status-left-custom "#[fg=#{@powerline-status-left-area-left-fg},bg=#{@powerline-status-left-area-left-bg},bold] #{@themepack-status-left-area-left-format} #[fg=#{@powerline-status-left-area-left-bg},bg=#{@powerline-status-left-area-middle-bg},nobold]#[fg=#{@powerline-status-left-area-middle-fg},bg=#{@powerline-status-left-area-middle-bg}] #{@themepack-status-left-area-middle-format} #[fg=#{@powerline-status-left-area-middle-bg},bg=#{@powerline-status-left-area-right-bg}]#[fg=#{@powerline-status-left-area-right-fg},bg=#{@powerline-status-left-area-right-bg}] #{@themepack-status-left-area-right-format} #[fg=#{@powerline-status-left-area-right-bg},bg=#{@theme-status-bg},nobold]"
set -goqF @theme-status-left-bg "#{@powerline-status-left-bg}"
set -goqF @theme-status-left-fg "#{@powerline-status-left-fg}"
set -goq @theme-status-left-length 40
set -goqF @theme-status-right "#[fg=#{@powerline-status-right-area-left-bg},bg=#{@theme-status-bg}]#[fg=#{@powerline-status-right-area-left-fg},bg=#{@powerline-status-right-area-left-bg}] #{@themepack-status-right-area-left-format} #[fg=#{@powerline-status-right-area-middle-bg},bg=#{@powerline-status-right-area-left-bg}]#[fg=#{@powerline-status-right-area-middle-fg},bg=#{@powerline-status-right-area-middle-bg}] #{@themepack-status-right-area-middle-format} #[fg=#{@powerline-status-right-area-right-bg},bg=#{@powerline-status-right-area-middle-bg}]#[fg=#{@powerline-status-right-area-right-fg},bg=#{@powerline-status-right-area-right-bg},bold] #{@themepack-status-right-area-right-format} "
set -goqF @theme-status-right-custom "#[fg=#{@powerline-status-right-area-left-bg},bg=#{@theme-status-bg}]#[fg=#{@powerline-status-right-area-left-fg},bg=#{@powerline-status-right-area-left-bg}] #{@themepack-status-right-area-left-format} #[fg=#{@powerline-status-right-area-middle-bg},bg=#{@powerline-status-right-area-left-bg}]#[fg=#{@powerline-status-right-area-middle-fg},bg=#{@powerline-status-right-area-middle-bg}] #{@themepack-status-right-area-middle-format} #[fg=#{@powerline-status-right-area-right-bg},bg=#{@powerline-status-right-area-middle-bg}]#[fg=#{@powerline-status-right-area-right-fg},bg=#{@powerline-status-right-area-right-bg},bold] #{@themepack-status-right-area-right-format} "
set -goqF @theme-status-right-bg "#{@powerline-status-right-bg}"
set -goqF @theme-status-right-fg "#{@powerline-status-right-fg}"
set -goq @theme-status-right-length 150
Expand All @@ -114,8 +114,8 @@ set -goqF @theme-window-status-activity-fg "#{@powerline-color-activity-1}"
set -goq @theme-window-status-separator ""
set -goqF @theme-window-status-current-bg "#{@powerline-color-main-1}"
set -goqF @theme-window-status-current-fg "#{@powerline-color-black-1}"
set -goqF @theme-window-status-format " #{@themepack-window-status-format} "
set -goqF @theme-window-status-current-format " #{@themepack-window-status-current-format} "
set -goqF @theme-window-status-format-custom " #{@themepack-window-status-format} "
set -goqF @theme-window-status-current-format-custom " #{@themepack-window-status-current-format} "

# Customizable prefixes and suffixes for @theme-* format options
set -goq @theme-status-left-prefix ""
Expand All @@ -128,10 +128,10 @@ set -goq @theme-window-status-prefix ""
set -goq @theme-window-status-suffix ""

# Apply prefixes and suffixes to @theme-* format options
set -gqF @theme-status-left "#{@theme-status-left-prefix}#{@theme-status-left}#{@theme-status-left-suffix}"
set -gqF @theme-status-right "#{@theme-status-right-prefix}#{@theme-status-right}#{@theme-status-right-suffix}"
set -gqF @theme-window-status-current-format "#{@theme-window-status-current-prefix}#{@theme-window-status-current-format}#{@theme-window-status-current-suffix}"
set -gqF @theme-window-status-format "#{@theme-window-status-prefix}#{@theme-window-status-format}#{@theme-window-status-suffix}"
set -gqF @theme-status-left "#{@theme-status-left-prefix}#{@theme-status-left-custom}#{@theme-status-left-suffix}"
set -gqF @theme-status-right "#{@theme-status-right-prefix}#{@theme-status-right-custom}#{@theme-status-right-suffix}"
set -gqF @theme-window-status-current-format "#{@theme-window-status-current-prefix}#{@theme-window-status-current-format-custom}#{@theme-window-status-current-suffix}"
set -gqF @theme-window-status-format "#{@theme-window-status-prefix}#{@theme-window-status-format-custom}#{@theme-window-status-suffix}"

# Apply @theme-* options to Tmux
set -gF display-panes-active-colour "#{@theme-display-panes-active-colour}"
Expand Down
16 changes: 8 additions & 8 deletions powerline/block/gray.tmuxtheme
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,11 @@ set -goqF @theme-status-bg "#{@powerline-status-bg}"
set -goqF @theme-status-fg "#{@powerline-status-fg}"
set -goq @theme-status-interval 1
set -goq @theme-status-justify centre
set -goqF @theme-status-left "#[fg=#{@powerline-status-left-area-left-fg},bg=#{@powerline-status-left-area-left-bg},bold] #{@themepack-status-left-area-left-format} #[fg=#{@powerline-status-left-area-left-bg},bg=#{@powerline-status-left-area-middle-bg},nobold]#[fg=#{@powerline-status-left-area-middle-fg},bg=#{@powerline-status-left-area-middle-bg}] #{@themepack-status-left-area-middle-format} #[fg=#{@powerline-status-left-area-middle-bg},bg=#{@powerline-status-left-area-right-bg}]#[fg=#{@powerline-status-left-area-right-fg},bg=#{@powerline-status-left-area-right-bg}] #{@themepack-status-left-area-right-format} #[fg=#{@powerline-status-left-area-right-bg},bg=#{@theme-status-bg},nobold]"
set -goqF @theme-status-left-custom "#[fg=#{@powerline-status-left-area-left-fg},bg=#{@powerline-status-left-area-left-bg},bold] #{@themepack-status-left-area-left-format} #[fg=#{@powerline-status-left-area-left-bg},bg=#{@powerline-status-left-area-middle-bg},nobold]#[fg=#{@powerline-status-left-area-middle-fg},bg=#{@powerline-status-left-area-middle-bg}] #{@themepack-status-left-area-middle-format} #[fg=#{@powerline-status-left-area-middle-bg},bg=#{@powerline-status-left-area-right-bg}]#[fg=#{@powerline-status-left-area-right-fg},bg=#{@powerline-status-left-area-right-bg}] #{@themepack-status-left-area-right-format} #[fg=#{@powerline-status-left-area-right-bg},bg=#{@theme-status-bg},nobold]"
set -goqF @theme-status-left-bg "#{@powerline-status-left-bg}"
set -goqF @theme-status-left-fg "#{@powerline-status-left-fg}"
set -goq @theme-status-left-length 40
set -goqF @theme-status-right "#[fg=#{@powerline-status-right-area-left-bg},bg=#{@theme-status-bg}]#[fg=#{@powerline-status-right-area-left-fg},bg=#{@powerline-status-right-area-left-bg}] #{@themepack-status-right-area-left-format} #[fg=#{@powerline-status-right-area-middle-bg},bg=#{@powerline-status-right-area-left-bg}]#[fg=#{@powerline-status-right-area-middle-fg},bg=#{@powerline-status-right-area-middle-bg}] #{@themepack-status-right-area-middle-format} #[fg=#{@powerline-status-right-area-right-bg},bg=#{@powerline-status-right-area-middle-bg}]#[fg=#{@powerline-status-right-area-right-fg},bg=#{@powerline-status-right-area-right-bg},bold] #{@themepack-status-right-area-right-format} "
set -goqF @theme-status-right-custom "#[fg=#{@powerline-status-right-area-left-bg},bg=#{@theme-status-bg}]#[fg=#{@powerline-status-right-area-left-fg},bg=#{@powerline-status-right-area-left-bg}] #{@themepack-status-right-area-left-format} #[fg=#{@powerline-status-right-area-middle-bg},bg=#{@powerline-status-right-area-left-bg}]#[fg=#{@powerline-status-right-area-middle-fg},bg=#{@powerline-status-right-area-middle-bg}] #{@themepack-status-right-area-middle-format} #[fg=#{@powerline-status-right-area-right-bg},bg=#{@powerline-status-right-area-middle-bg}]#[fg=#{@powerline-status-right-area-right-fg},bg=#{@powerline-status-right-area-right-bg},bold] #{@themepack-status-right-area-right-format} "
set -goqF @theme-status-right-bg "#{@powerline-status-right-bg}"
set -goqF @theme-status-right-fg "#{@powerline-status-right-fg}"
set -goq @theme-status-right-length 150
Expand All @@ -114,8 +114,8 @@ set -goqF @theme-window-status-activity-fg "#{@powerline-color-activity-1}"
set -goq @theme-window-status-separator ""
set -goqF @theme-window-status-current-bg "#{@powerline-color-main-1}"
set -goqF @theme-window-status-current-fg "#{@powerline-color-black-1}"
set -goqF @theme-window-status-format " #{@themepack-window-status-format} "
set -goqF @theme-window-status-current-format " #{@themepack-window-status-current-format} "
set -goqF @theme-window-status-format-custom " #{@themepack-window-status-format} "
set -goqF @theme-window-status-current-format-custom " #{@themepack-window-status-current-format} "

# Customizable prefixes and suffixes for @theme-* format options
set -goq @theme-status-left-prefix ""
Expand All @@ -128,10 +128,10 @@ set -goq @theme-window-status-prefix ""
set -goq @theme-window-status-suffix ""

# Apply prefixes and suffixes to @theme-* format options
set -gqF @theme-status-left "#{@theme-status-left-prefix}#{@theme-status-left}#{@theme-status-left-suffix}"
set -gqF @theme-status-right "#{@theme-status-right-prefix}#{@theme-status-right}#{@theme-status-right-suffix}"
set -gqF @theme-window-status-current-format "#{@theme-window-status-current-prefix}#{@theme-window-status-current-format}#{@theme-window-status-current-suffix}"
set -gqF @theme-window-status-format "#{@theme-window-status-prefix}#{@theme-window-status-format}#{@theme-window-status-suffix}"
set -gqF @theme-status-left "#{@theme-status-left-prefix}#{@theme-status-left-custom}#{@theme-status-left-suffix}"
set -gqF @theme-status-right "#{@theme-status-right-prefix}#{@theme-status-right-custom}#{@theme-status-right-suffix}"
set -gqF @theme-window-status-current-format "#{@theme-window-status-current-prefix}#{@theme-window-status-current-format-custom}#{@theme-window-status-current-suffix}"
set -gqF @theme-window-status-format "#{@theme-window-status-prefix}#{@theme-window-status-format-custom}#{@theme-window-status-suffix}"

# Apply @theme-* options to Tmux
set -gF display-panes-active-colour "#{@theme-display-panes-active-colour}"
Expand Down
Loading

0 comments on commit c7ab152

Please sign in to comment.