gpt4 book ai didi

zsh - 当 ZSH_THEME ="random"时,如何确定您所在的主题

转载 作者:行者123 更新时间:2023-12-02 05:16:05 24 4
gpt4 key购买 nike

我找到了一个我喜欢的主题,但只是在命令行上执行了一个有大量输出的程序之后,所以我不知道当前主题的名称!

这是我的 .zshrc 的相关部分:

# Set name of the theme to load.
...
ZSH_THEME="random"

有没有办法确定我所在的主题?

最佳答案

根据oh-my-zsh.sh L81-87 :

if [ "$ZSH_THEME" = "random" ]; then
themes=($ZSH/themes/*zsh-theme)
N=${#themes[@]}
((N=(RANDOM%N)+1))
RANDOM_THEME=${themes[$N]}
source "$RANDOM_THEME"
echo "[oh-my-zsh] Random theme '$RANDOM_THEME' loaded..."

因此您应该能够打印随机主题的路径

print $RANDOM_THEME

关于zsh - 当 ZSH_THEME ="random"时,如何确定您所在的主题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31642930/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com