summaryrefslogtreecommitdiff
path: root/oh-my-zsh.sh
diff options
context:
space:
mode:
authorCasey Watson <watsoncj@gmail.com>2011-05-24 12:15:58 -0600
committerCasey Watson <watsoncj@gmail.com>2011-05-24 12:24:52 -0600
commit5c1b341132119f08047a506e2c2b06fa0c0db52e (patch)
tree87e5c421d8eb0c2989b2dc886a4040a9789189eb /oh-my-zsh.sh
parent2440954f062a19f1b7393c02701cc71d19539e84 (diff)
downloadzsh-5c1b341132119f08047a506e2c2b06fa0c0db52e.tar.gz
zsh-5c1b341132119f08047a506e2c2b06fa0c0db52e.tar.bz2
zsh-5c1b341132119f08047a506e2c2b06fa0c0db52e.zip
Fix to random theme selection
- themes array is 1-based - theme files names are located in indicies 1 through N inclusive - this resolves an issue where you would occasionally see: "no such file or directory. Random theme '' loaded..."
Diffstat (limited to 'oh-my-zsh.sh')
-rw-r--r--oh-my-zsh.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh
index 3ea88e924..2a206798d 100644
--- a/oh-my-zsh.sh
+++ b/oh-my-zsh.sh
@@ -31,7 +31,7 @@ if [ "$ZSH_THEME" = "random" ]
then
themes=($ZSH/themes/*zsh-theme)
N=${#themes[@]}
- ((N=RANDOM%N))
+ ((N=(RANDOM%N)+1))
RANDOM_THEME=${themes[$N]}
source "$RANDOM_THEME"
echo "[oh-my-zsh] Random theme '$RANDOM_THEME' loaded..."