Skip to content

v2.2.0 — Text styling

Choose a tag to compare

@aovestdipaperino aovestdipaperino released this 31 Aug 12:08
· 52 commits to main since this release

Text styling attributes

Attr now carries a Style bitset alongside foreground/background colors, supporting bold, dim, italic, underline, reverse (inverse video), and strikethrough.

  • Composable builders: Attr::new(fg, bg).bold().italic(), or .with_style(Style::ITALIC | Style::UNDERLINE).
  • Emitted as real SGR codes on the live terminal + SSH (Terminal::flush) and in ANSI screen dumps (ansi_dump).
  • The ANSI parser recognizes incoming style codes; the help viewer renders **bold**/*italic* markdown with real terminal styles.
  • New text_styling example: cargo run --example text_styling.

Backward compatibleAttr::new(fg, bg) keeps its two-argument signature (style defaults to empty). The classic color byte still encodes colors only (to_u8/from_u8 drop style, by design). PNG screenshots remain color-only; blink is intentionally unsupported.

See the CHANGELOG for full details.