Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Config loading but not held in memory #9

Open
walkerh opened this issue May 2, 2024 · 0 comments
Open

Config loading but not held in memory #9

walkerh opened this issue May 2, 2024 · 0 comments

Comments

@walkerh
Copy link

walkerh commented May 2, 2024

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:

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant