]> arthur.barton.de Git - ax-zsh.git/commitdiff
Fix catching up the "ax-io", "zprofile" and "zlogin" stages
authorAlexander Barton <alex@barton.de>
Sat, 10 Feb 2024 16:33:33 +0000 (17:33 +0100)
committerAlexander Barton <alex@barton.de>
Sat, 10 Feb 2024 16:43:28 +0000 (17:43 +0100)
Especially fix running the "zlogin" stage and exporting the
AXZSH_ZPROFILE_READ variable.

And add some more comments clarifying what's going on and why.

core/01_zprofile/01_zprofile.zshrc
core/99_zlogin/99_zlogin.zshrc

index 4ad618ae7d37c059771d525be5b9a49210639bb4..8e257cd46ca9159270c60145ff64b72b75fd9fc6 100644 (file)
@@ -1,20 +1,21 @@
 # AX-ZSH: Alex' Modular ZSH Configuration
-# 01_zprofile.zshrc: Make sure zpfofile files are read
+# 01_zprofile.zshrc: Make sure zprofile files are read
 
 [[ -z "$AXZSH_ZPROFILE_READ" ]] || return
 
-# No "ax-io" and "zprofile" files have been read in already, looks like this is
-# a non-login shell instance and not a (direct) child of a AX-ZSH enabled login
-# shell! So we have to make sure everything is set up properly by reading in
-# the "ax-io" and "zprofile" stages first!
-
-[[ -n "$AXZSH_DEBUG" ]] && echo "» 01_zprofile.zsh:"
+# No "zprofile" (and "ax-io") stage files have been read in already, so looks
+# like this is a non-login shell instance but not a (direct) child of an AX-ZSH
+# enabled login shell! This can happen in graphical terminals not starting a
+# login shell, for example. So most probably some environment configuration is
+# missing and we have to make sure everything is set up properly by reading in
+# the "ax-io" and "zprofile" stages before continuing!
+[[ -n "$AXZSH_DEBUG" ]] && echo "» 01_zprofile.zshrc:"
 
 # Reset some environment variables, that could contain "garbage" ...
 unset PS1
 
-axzsh_handle_stage "01_zprofile.zsh" "ax-io"
-axzsh_handle_stage "01_zprofile.zsh" "zprofile"
+axzsh_handle_stage "01_zprofile.zshrc" "ax-io"
+axzsh_handle_stage "01_zprofile.zshrc" "zprofile"
 AXZSH_ZPROFILE_READ=2
 
-[[ -n "$AXZSH_DEBUG" ]] && echo "» 01_zprofile.zsh (end)"
+[[ -n "$AXZSH_DEBUG" ]] && echo "» 01_zprofile.zshrc (end)"
index bdb106b2bde5a47f50df4a60026a305b0b641e24..0133012a6fb98e8b6b9c5674adb9cbf06d5fcdcd 100644 (file)
@@ -1,14 +1,15 @@
 # AX-ZSH: Alex' Modular ZSH Configuration
-# 99_zlogin.zshrc: Make sure zpfofile files are read
+# 99_zlogin.zshrc: Make sure zlogin 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!
+# AXZSH_ZPROFILE_READ is set to 2 when the "ax-io" and "zprofile" were caught
+# up because this is not a login shell and the environment was missing. In this
+# case the "zlogin" stage will be missing in the end as well and therefore we
+# run the "zlogin" stage manually, too.
+[[ -n "$AXZSH_DEBUG" ]] && echo "» 99_zlogin.zshrc:"
 
-[[ -n "$AXZSH_DEBUG" ]] && echo "» 99_zlogin.zsh:"
-for plugin ($plugin_list); do
-       axzsh_load_plugin "$plugin" "zlogin"
-done
+axzsh_handle_stage "99_zlogin.zshrc" "zlogin"
 AXZSH_ZLOGIN_READ=2
-[[ -n "$AXZSH_DEBUG" ]] && echo "» 99_zlogin.zsh (end)"
+
+[[ -n "$AXZSH_DEBUG" ]] && echo "» 99_zlogin.zshrc (end)"