From 8ac5668b44d59bcc99950e8d65b82d2aa3047ef3 Mon Sep 17 00:00:00 2001 From: Alexander Barton Date: Mon, 6 Jul 2015 23:30:30 +0200 Subject: [PATCH] 01_zprofile & 99_zlogin: Make sure z{profile|login} is read Make sure that all the z{profile|login} plugins have been read, in the current (login) ZSH, or in an parent ZSH, and read them in before and after all the "zshrc" files if not. --- core/01_zprofile/01_zprofile.zprofile | 4 ++++ core/01_zprofile/01_zprofile.zshrc | 17 +++++++++++++++++ core/99_zlogin/99_zlogin.zlogin | 5 +++++ core/99_zlogin/99_zlogin.zshrc | 14 ++++++++++++++ 4 files changed, 40 insertions(+) create mode 100644 core/01_zprofile/01_zprofile.zprofile create mode 100644 core/01_zprofile/01_zprofile.zshrc create mode 100644 core/99_zlogin/99_zlogin.zlogin create mode 100644 core/99_zlogin/99_zlogin.zshrc diff --git a/core/01_zprofile/01_zprofile.zprofile b/core/01_zprofile/01_zprofile.zprofile new file mode 100644 index 0000000..e914645 --- /dev/null +++ b/core/01_zprofile/01_zprofile.zprofile @@ -0,0 +1,4 @@ +# AX-ZSH: Alex' Modular ZSH Configuration +# 01_zprofile.zprofile: Initialize AX-ZSH profile settings + +AXZSH_ZPROFILE_READ=1 diff --git a/core/01_zprofile/01_zprofile.zshrc b/core/01_zprofile/01_zprofile.zshrc new file mode 100644 index 0000000..5b6493e --- /dev/null +++ b/core/01_zprofile/01_zprofile.zshrc @@ -0,0 +1,17 @@ +# AX-ZSH: Alex' Modular ZSH Configuration +# 01_zprofile.zshrc: Make sure zpfofile files are read + +[[ -z "$AXZSH_ZPROFILE_READ" ]] || return + +# No "zprofile" files have been read in already! So most probably this +# ZSH instance hasn't been called from an ax-zsh enabled ZSH! + +# Reset some environment variables, that could contain "garbage" ... +unset PS1 + +[[ -f "$HOME/.axzsh.debug" ]] && echo "» 01_zprofile.zsh:" +for plugin ($plugin_list); do + axzsh_load_plugin "$(basename "$plugin")" "zprofile" +done +AXZSH_ZPROFILE_READ=2 +[[ -f "$HOME/.axzsh.debug" ]] && echo "» 01_zprofile.zsh (end)" diff --git a/core/99_zlogin/99_zlogin.zlogin b/core/99_zlogin/99_zlogin.zlogin new file mode 100644 index 0000000..69586df --- /dev/null +++ b/core/99_zlogin/99_zlogin.zlogin @@ -0,0 +1,5 @@ +# AX-ZSH: Alex' Modular ZSH Configuration +# 99_zlogin.zlogin: Mark AX-ZSH zprofile/zlogin as read + +export AXZSH_ZPROFILE_READ=1 +export AXZSH_ZLOGIN_READ=1 diff --git a/core/99_zlogin/99_zlogin.zshrc b/core/99_zlogin/99_zlogin.zshrc new file mode 100644 index 0000000..4f96617 --- /dev/null +++ b/core/99_zlogin/99_zlogin.zshrc @@ -0,0 +1,14 @@ +# AX-ZSH: Alex' Modular ZSH Configuration +# 99_zlogin.zshrc: Make sure zpfofile files are read + +[[ "$AXZSH_ZPROFILE_READ" = "2" ]] || return + +# No "zlogin" files have been read in already! So most probably this +# ZSH instance hasn't been called from an ax-zsh enabled ZSH! + +[[ -f "$HOME/.axzsh.debug" ]] && echo "» 99_zlogin.zsh:" +for plugin ($plugin_list); do + axzsh_load_plugin "$(basename "$plugin")" "zlogin" +done +AXZSH_ZLOGIN_READ=2 +[[ -f "$HOME/.axzsh.debug" ]] && echo "» 99_zlogin.zsh (end)" -- 2.39.2