iterm-tab-color-oh-my-zsh icon indicating copy to clipboard operation
iterm-tab-color-oh-my-zsh copied to clipboard

Config loading but not held in memory

Open walkerh opened this issue 10 months ago • 0 comments

At least on my machine, the configuration would not stay in memory unless I explicitly forced tcConfigColors and orderedConfig to be global by adding the -g option to declare.

My system:

  • zsh 5.9 (x86_64-apple-darwin22.0)
  • Oh My Zsh https://github.com/ohmyzsh/ohmyzsh/commit/803e1a784cd520f101d126b47deea3297e6a82fc
  • macOS 13.6.3 (22G436)

Here is my patch:

diff --git a/iterm-tab-color.plugin.zsh b/iterm-tab-color.plugin.zsh
index 625ab19..f6c3021 100644
--- a/iterm-tab-color.plugin.zsh
+++ b/iterm-tab-color.plugin.zsh
@@ -1,6 +1,6 @@
 tcConfigFilePath="$(dirname "$0")/.tc-config"
-declare -A tcConfigColors
-declare -a orderedConfig
+declare -gA tcConfigColors
+declare -ga orderedConfig
 while IFS="=" read -r configKey hexValue || [ -n "$hexValue" ]; do
   if ! ( [[ $configKey == \#* ]]); then
     orderedConfig+=( $configKey )

Thoughts? Do you want a PR with this?

walkerh avatar May 02 '24 18:05 walkerh