I installed the zsh package.

Also, I downloaded the oh-my-zsh framework to customize zsh. When I change theme name in .zshrc file to one of the themes given here, it changes the color/type of prompt among other things but the background color stays the same. I want the background color to change to the ones given on that theme wiki page.

So, how do I do change the background color automatically to the ones on that page whenever I change my theme?


For example, I changed in ~/.oh-my-zsh/themes/example.zsh-theme file the line:

PROMPT="%{$fg[red]%}%n%{$reset_color%}@%{$fg[blue]%}%m %{$fg[yellow]%}%~ %{$reset_color%}%% "

with the line:

PROMPT="%{$bg[cyan]%}%{$fg[red]%}%n%{$reset_color%}%{$bg[cyan]%}@%{$fg[red]%}%m %{$fg[yellow]%}%~ %{$reset_color%}%{$bg[cyan]%}%% "

And look what happened:


So, I suggest you to play in the same manner with which theme do you wish from ~/.oh-my-zsh/themes directory.

  • Note unless you set RPROMPT='%{$reset_color%}' any command output to the terminal will also carry that background color. I guess it depends on whether you want all lines to have the same color or if you just want the prompt line to have a different color. (Personally I wanted to keep my terminal's default BG color but change the prompt line.) – thom_nic Aug 31 '16 at 16:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.