AskUserQuestion option previews render ANSI color escapes as literal text (regression)

Status Open
Reported on v2.1.292
Maintainer reply None cached
Activity 0 comments · opened Oct 7, 2026

Option preview content containing ANSI SGR color sequences used to render as colored text in the preview pane. Since a recent update, the ESC byte is drawn as � and the rest of the sequence appears as literal text.

Repro: call AskUserQuestion with an option whose preview is "\^[[48;2;14;82;72m \^[[0m Teal".

  • Expected: a teal swatch followed by "Teal".
  • Actual: �[48;2;14;82;72m �[0m Teal.

Why it matters: a personal skill uses truecolor swatches in previews to pick per-project terminal background colors. Telling dark hues apart there needs real color, and neither hex codes nor emoji approximations are usable substitutes.

Version: 2.1.292 on macOS 26 (Darwin 25.5). Possibly related to the 2.1.288 change "Fixed text with a tab, a stray escape and a C1 control … drawing over the rows below it". If stripping escapes was intentional for safety, consider allowing SGR (color/style) sequences in previews while still sanitizing cursor movement.

View original on GitHub ↗