bullet-train.zsh
                                
                                
                                
                                    bullet-train.zsh copied to clipboard
                            
                            
                            
                        How to change color of '$'
How do I change the color of the $ prompt?
I've tried using color escape codes in the BULLETTRAIN_PROMPT_CHAR variable but then the $ becomes invisible.
echoing the same text gives the $ in the proper color.
:+1: it's not only the color, we can't set anything to BULLETTRAIN_PROMPT_CHAR, i tried to set custom text or another segment, nothing works. It is just just empty when set anything different than $.
@tunnckoCore Strange, custom text works for me:
if [ -n "${BULLETTRAIN_PROMPT_CHAR+1}" ]; then
    BULLETTRAIN_PROMPT_CHAR="λ"
fi
Just near the start.
Hm. Maybe. I tried with direct assign BULLETTRAIN_PROMPT_CHAR=" foo "
@tunnckoCore Are you setting it in your .zshrc? I suppose you have to set it in ~/.oh-my-zsh/themes/bullet-train.zsh-theme
@bharadwaj-raju the whole idea for that variables are to control themes out of theme files.
@tunnckoCore Hmm. This seems to do it outside the theme source:
source ~/.path/to/bullet-train.zsh-theme  # do not use the 'plugins' or 'ZSH_THEME' of oh-my-zsh
if [ -n "${BULLETTRAIN_PROMPT_CHAR+1}" ]; then
    BULLETTRAIN_PROMPT_CHAR="λ"
fi
                                    
                                    
                                    
                                
Don't see sense and value on your example. oh-my-zsh is already loaded the things in anyway.
In anyway, i stopped using ohz and this theme already.
i stopped using ohz
I've switched to prezto and get a fresh set of issues... time to change theme.
I am trying to change the prompt, with this code in .zshrc
BULLETTRAIN_PROMPT_CHAR="»"
but all I have is an invisible prompt
what do I am it wrong?
@unluisco, Maybe the terminal app you're using can't render that character properly?
Yes @unluisco, try pasting it into the prompt (or anywhere, say cat) and see if it shows up.
now the prompt work fine, thanks
Amazing! Can we close the issue?
I've switched to prezto and get a fresh set of issues... time to change theme.
It looks like it's invalid now, as @bharadwaj-raju, the original reporter moved on. And @unluisco's problem was different from this issue.
@unluisco what was your fix? My prompt char is not showing either, not even if I use plain text.....
@ChristianVermeulen, Could you post the part of your .zshrc that fiddles with "Bullet Train"?
@ChristianVermeulen make sure you put the character inside parenthesis and double quotes like so: (">>").
To answer the original question, though. You set the color code with %{FG[color]%} where color is a 3 digit color code (found by running spectrum_ls in zsh terminal). You can also use fg[color] where color is text like "red". Here is mine: BULLETTRAIN_PROMPT_CHAR=("%{$fg[red]%}>>")
Maybe we should introduce new variable, something like BULLETTRAIN_PROMPT_COLOR ?
My prompt character always renders correctly but I still cannot change the color
Even when I do: BULLETTRAIN_PROMPT_CHAR=("%{$fg[red]%}>>")
The prompt shows as just ">>" but it is still green
Show us your .zshrc
I have to periodically reload .zshrc for some reason for the color to stick.  So in the terminal just do . <pathto/.zshrc>