PS1 hostname can only be certain colors. (zsh) #223

Closed
sauluskahn opened this Issue Sep 25, 2012 · 0 comments

Comments

Projects
None yet
1 participant

edit: Bolded colors are grey. Forgot to check for %B in my PS1 smack

Hello, I'm experiencing some trouble with setting my hostname color. 'white' and 'red' seem to work across all machines, however, 'yellow' and 'green' work on exactly none of them. When I try 'yellow' or 'green' the color is more of a gray. This problem persists across three machines, and a yellow hostname works just fine when I'm in a TTY, but running zsh under urxvt and X breaks this somehow.

For reference, here are the relevant sections of my .zshrc:

autoload -U colors && colors

case $HOST in
    hostname1)
        hostcolor=white
        ;;
    hostname2)
        hostcolor=yellow
        ;;
    hostname3)
        hostcolor=green
        ;;
    *)
        hostcolor=gray
        ;;
esac
PS1="%{$fg[$hostcolor]%}%B%m%b%u%{$reset_color%}:%{$fg[green]%}%2~%{$fg[magenta]%}%%%{$reset_color%} "

sauluskahn closed this Sep 29, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment