Change the background color of command line in zsh when I change the prompt theme

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?


Solution 1:

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:

zsh

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