§R2.1 Attribute Codes

All styling uses CSI sequences: ESC[{params}m (where ESC = \x1b or \033).

CodeAttributeReset CodeUse in Monospace TUI
0Reset allClear all attributes
1Bold22Display and Title typography (Standard §7.1)
2Dim (faint)22Label typography, Disabled state (Standard §7.1, §8.1)
3Italic23Sparingly — not in standard typography roles
4Underline24Hovered state, mnemonics (Standard §8.1)
7Reverse video27Focused and Selected states (Standard §8.1)
9Strikethrough29Deprecated items only

§R2.2 Typography Role → SGR Mapping

Typography RoleSGR SequenceExample
DisplayESC[1m (+ uppercase in source)ESC[1mDASHBOARDESC[22m
TitleESC[1mESC[1mSection HeaderESC[22m
Body(no attributes)Normal content text
LabelESC[2mESC[2mLast updated: 12:34ESC[22m

§R2.3 State → SGR Mapping

StateSGR SequenceNotes
Enabled(no attributes)Default rendering
FocusedESC[7mReverse video
HoveredESC[4mUnderline (mouse contexts)
PressedESC[7mESC[27m (within ≤100ms)Brief reverse flash
SelectedESC[7m + fill mark characterReverse video with [X] or (*)
DisabledESC[2mDim/faint
ErrorESC[31m or ESC[91mRed foreground (standard or bright)
Error (severe)ESC[41mRed background

§R2.4 Standard Foreground Colors

ColorStandard FGBright FGStandard BGBright BG
Black309040100
Red319141101
Green329242102
Yellow339343103
Blue349444104
Magenta359545105
Cyan369646106
White379747107
Default3949

§R2.5 Extended Color Sequences

256-color mode:

Foreground: ESC[38;5;{n}m    (n = 0–255)
Background: ESC[48;5;{n}m    (n = 0–255)

Truecolor (24-bit):

Foreground: ESC[38;2;{r};{g};{b}m    (r, g, b = 0–255)
Background: ESC[48;2;{r};{g};{b}m    (r, g, b = 0–255)