Plugin load order and dependency handling in Oh My Zsh
0 reputation · 24 Mar 2020, 08:25 UTC
Goal
When enabling many Oh My Zsh plugins through the ZSH_PLUGINS array, the shell must load them in an order that satisfies internal dependencies and avoids runtime conflicts.
Constraints
- Plugins are sourced sequentially from the
$ZSH/pluginsdirectory. - Some plugins (e.g.,
git,docker) rely on other plugins or shell variables that may not be initialized if loaded too late. - Aliasing or function overrides can collide when multiple plugins provide the same command names.
Unresolved Decision
Oh My Zsh does not expose a declarative mechanism to declare plugin dependencies or enforce an explicit load order. Users must manually reorder the ZSH_PLUGINS array or rely on undocumented conventions.
Specific Questions
1. Is there an official method or configuration flag to declare plugin dependencies so that Oh My Zsh can arrange the load sequence automatically?
2. How can we detect and resolve alias or function conflicts that arise from overlapping plugin definitions during startup?
3. Would adding a lightweight dependency resolver to the framework be feasible without significantly impacting startup latency?