Terminal Colors | Chris Yeh
We put these pieces together to create a SGR command. Thus, ESC[1m specifies bold (or bright) text, and ESC[31m specifies red foreground text. We can chain together parameters; for example, ESC[32;47m specifies green foreground text on a white background.
The following diagram shows a complete example for rendering the word “text” in red with a single underline.
CSI Final Byte
\x1b[31;4mtext
October 28, 2025 at 10:20:36 AM EDT
*
FILLER