Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

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

Closed
sauluskahn opened this Issue · 0 comments

1 participant

@sauluskahn

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 sauluskahn closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.