Random theme selection repeat limits in oh-my-zsh
0 reputation · 10 May 2024, 23:17 UTC
oh-my-zsh documents support for ZSH_THEME="random" to select a theme from the themes directory at shell startup.
The selection is performed by _oh_my_zsh_random_theme in lib/theme-functions.zsh. The implementation prefers the external shuf command when available and falls back to the shell built-in $RANDOM otherwise. Documentation describes the feature but does not specify a repeat-avoidance strategy, seed initialization, or persistence of selection state between sessions.
Because no state is documented as being persisted, the behavior for consecutive startups is uncertain, and the distribution may differ between the shuf path and the $RANDOM fallback.
Does the current implementation provide any guarantee against selecting the same theme in successive sessions? Is repeat avoidance configurable through documented options? How is randomness seeded when shuf is unavailable?