为了更好地识别命令行上输出的开始和结束,我想更改提示的颜色,以便它与程序输出明显不同.当我使用zsh时,任何人都可以给我一个提示吗?
我想弄清楚为什么我的oh-my-zsh主题不能正常工作.颜色正确显示,但背景保持白色(黑色文字).下面是我的/.zshrc文件和当前路径变量:
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
export ZSH_THEME="robbyrussell"
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
# Set to this to use case-sensitive completion
# CASE_SENSITIVE="true"
# Comment this out to disable weekly auto-update checks
# DISABLE_AUTO_UPDATE="true" …Run Code Online (Sandbox Code Playgroud) 我在配置 zsh 提示时遇到了一些困难。具体来说,我希望字体具有由十六进制代码定义的颜色:#87afdf
目前,我已按如下方式设置提示:
PROMPT='%B[%d]
? %b'
Run Code Online (Sandbox Code Playgroud)
我尝试通过以下方式添加颜色:
autoload -U colors && colors
PROMPT='%{$fg[#87afdf]%}%B[%d]
? %b%{$reset_color%}'
Run Code Online (Sandbox Code Playgroud)
但这只会给我以下胡言乱语:
$fg[#87afdf][/Users/gregory]
? $reset_color
Run Code Online (Sandbox Code Playgroud)
任何关于如何进行的想法将不胜感激。