相关疑难解决方法(0)

如何在zsh中更改提示的颜色(与普通文本不同)?

为了更好地识别命令行上输出的开始和结束,我想更改提示的颜色,以便它与程序输出明显不同.当我使用zsh时,任何人都可以给我一个提示吗?

zsh prompt colors

93
推荐指数
10
解决办法
12万
查看次数

哦-my-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 zshrc osx-lion

18
推荐指数
1
解决办法
3万
查看次数

如何定义在 ZSH 提示中使用的自定义颜色?

我在配置 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)

任何关于如何进行的想法将不胜感激。

configuration zsh prompt zshrc

6
推荐指数
3
解决办法
8500
查看次数

标签 统计

zsh ×3

prompt ×2

zshrc ×2

colors ×1

configuration ×1

osx-lion ×1