我使用的是 Fedora 31 操作系统,已经安装了 ZSH(Oh-my-zsh)并且使用了 PowerLevel10k 主题。当我打开 Gnome 终端时,ZSH 成为了默认的 shell,像我预期的那样,但是 Powerlevel10k 只有在我输入 source ~/.zshrc
后才会被加载。
下面是我的 zshrc 文件内容:
plugins=(git)
source $ZSH/oh-my-zsh.sh
ZSH_THEME=powerlevel10k/powerlevel10k
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
"~/.zshrc" 110L, 4104C
还有一件重要的事情是,每次我输入source ~/.zshrc
命令时,都会出现以下错误,但使用Powerlevel10k时一切正常:
[ERROR]: When using instant prompt, Powerlevel10k must be loaded before the first prompt.
~/.zshrc
文件? 您能验证这是否确实是问题吗?如果是,首先需要修复这个问题。 - user1934428