I've been learning how to customize my prompt with colors. I understand that you can define red text with


and define an RGB color (in the following example, R=255, G=95, B=255) as


To make the first command bold, you can just change the 0 to a 1:


But how do you make the RGB command bold?

2 Answers 2


You can combine the two:

printf %b == '\e[1m' '\e[38;2;255;95;255m' FOO '\e[m' == '\n'

The first sets the bold attribute, the second sets the color.

You should check whether your terminal emulator really supports bold characters (and isn't emulating them with color / reverse video or just ignoring them in some modes, as does eg. the linux vt) and enable it if it's disabled. Most terminal emulators working under X11 need no extra configuration for that.

Eg. for xterm you may have to set *colorBDMode: false in .Xresources if it was disabled somehow. The same goes for italic and underlined characters: *colorITMode: false, *colorBLMode: false.

  • Thanks, I didn't realize you could set bold without specifying a color. So in summary, \e[1m sets bold.
    – Trevor
    Nov 13, 2018 at 22:51

Bold is a character-related video attribute, usually thicker lines, but which in some devices is imitated using bright colors (a change in intensity).

RGB already gives the color intensity, so at most you'll find some terminals doing something like changing the levels a little — but nothing that you can count on in different terminals.

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.