You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Markdown ANSI escape sequences rendered as literal text in TUI (wrapped numbered lists) #1143
In the interactive TUI, parts of the markdown styling (bold, truecolor codespans) leak to the screen as LITERAL text. Users see raw sequences like: 1. [1mPasien ini...[22m and [38;2;67;56;202m1147958[39m. This makes assistant responses unreadable and pollutes anything copied from the terminal.
Expected Behavior
Markdown should render as styled text (bold/colored) in the TUI. ANSI escape sequences should be applied as styling or stripped entirely — never printed as visible literal text like [1m or [38;2;R;G;Bm.
Actual Behavior
Bold/codespan styling inside LONG numbered-list items that WRAP across physical lines shows literal [1m, [22m, [38;2;R;G;Bm, [39m sequences (the ESC byte is missing; the rest prints as text). Tables, short lines, and codespans that fit on one line render correctly. Verified on BOTH themes: light leaks rgb(67,56,202)=#4338CA (theme CODE color), dark leaks rgb(177,186,249)=#B1BAF9.
Steps to reproduce the issue
Run cmd interactive TUI in foot 1.21 inside tmux 3.8 (TERM=tmux-256color, COLORTERM=truecolor).
Ask the model for a response containing long numbered-list items with bold and inline codespans (text long enough to wrap across multiple physical lines).
Observe: wrapped list items show literal [1m / [38;2;...m text; tables and short lines are fine.
Compare: cmd -p "same prompt" (headless) prints CLEAN output with 0 ESC bytes; the session .jsonl file also stores clean markdown — the corruption happens only in the interactive TUI render path.
Also reproduces with a plain launcher (no user patches: node dist/index.mjs directly).
Suspected component: the TUI markdown render path — marked-terminal + chalk (truecolor) feeding ink 7.1.0. ink/build/ink.js line 392 wraps output with wrapAnsi(output, width, {trim:false, hard:true}), and ink 7.1's new build/ansi-tokenizer.js slices/reassembles styled text. hard-wrapping inside a styled run and/or token re-assembly appears to drop the leading ESC byte or split a CSI sequence so the remainder prints literally.
Evidence: model output in session .jsonl is clean markdown; headless cmd -p is clean (0 ESC bytes); bug persists with all user patches removed and on both themes.
Activity
magicprinc commentedon Nov 13, 2026
see also #1138
naymurdev commentedon Nov 13, 2026
Thanks for creating the issue!! @vipulgupta2048 can u have look at it