zshpromptoh-my-zshzshrc

my zsh prompt is not bold


I am customizing my zsh terminal but I face difficulties when it comes to turn my prompt into bold. I tried several different things, but none worked, whereas it did work for people on the Internet...

So this is my test prompt. Both "HEY" are in color 1, but the second "HEY" is supposed to be bold. It is obviously not, and instead of that, I get some flashy red, like the first part of my prompt, which is in color 9. wtf :)

Here is the code that I use in this case:

HEY%BHEY%b

I also noticed that it does the same thing for every one of the 8 first colors: black becomes grey, grey becomes white, night blue becomes dark blue, leaf green becomes flashy green, same for pink, yellow...

I also tried to use some escape sequences with the modulo, but none worked: each time, the modulo took the character next to it as its parameter and the rest of the code would just be displayed like normal characters. For example, this:

PS1="%{\e[1;33%}test"

would display this:

\e[1;33test

Could someone explain me what is going wrong here and how I could fix it to have some (real) bold prompt text?


Solution

  • "ANSI" colors (escape codes) has a "bold" attribute, but it is often interpreted as "bright" instead. You may have to look in your terminal application's options to see if you can reconfigure it to interpret bold as bold instead of bright. I think you have to choose between supporting "bold" and "bright colors". See also https://en.wikipedia.org/wiki/ANSI_escape_code#Colors