9

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?

2 Answers 2

4

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.

1
  • 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, 2016 at 16:50
1

Right click on your terminal and there click on preferences option, it will open a new window; in the new window goto tab colors and there uncheck the checkbox "Use colors from system theme", doing this will load the background of your theme, we can also change further stylings from here. Image of prefrences

1
  • 10 years later... this is the correct answer.
    – Colm
    May 19, 2023 at 9:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .