From fd02a9f8b1fe0d291dd0c09aa32e8dc197c3fd29 Mon Sep 17 00:00:00 2001 From: Alexander Barton Date: Sun, 3 Feb 2019 22:51:49 +0100 Subject: [PATCH] Include the theme into the global context This is required by some (OhMyZsh) themes ... --- ax.zsh | 13 +++++++++++++ core/90_theme/90_theme.zshrc | 9 +++++---- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/ax.zsh b/ax.zsh index fbacf6c..4387f8d 100644 --- a/ax.zsh +++ b/ax.zsh @@ -177,6 +177,19 @@ else for plugin ($plugin_list); do axzsh_load_plugin "$plugin" "$script_type" "$cache_file" done + + # Read the "theme file", if any and in "zshrc" stage: + if [[ "$script_type" = "zshrc" ]]; then + if [[ -r "$AXZSH_THEME" ]]; then + source "$AXZSH_THEME" + if [[ -n "$cache_file" ]]; then + # Include the theme into the new cache file: + echo "# BEGIN Theme" >>"$cache_file" + "$cat_cmd" "$AXZSH_THEME" >>"$cache_file" + echo "# END Theme" >>"$cache_file" + fi + fi + fi fi # Clean up ... diff --git a/core/90_theme/90_theme.zshrc b/core/90_theme/90_theme.zshrc index 4c508fb..140c73a 100644 --- a/core/90_theme/90_theme.zshrc +++ b/core/90_theme/90_theme.zshrc @@ -5,14 +5,15 @@ # simple and sane built-in prompt that should work "everywhere". And try to # make sure that nothing else "disturbs" such terminals ... if axzsh_is_dumb_terminal; then + unset AXZSH_THEME + + # Set simple prompt: PS1="%n@%m:%3~ %# " unset RPS1 # See unset zle_bracketed_paste - - return fi -# Read in the theme configuration. -[[ -n "$AXZSH_THEME" ]] && source "$AXZSH_THEME" +# NOTE: The theme itself is read in by the ax.zsh script itself: last and into +# the global context (code for the cache file is generated as required). -- 2.39.2