Skip to content

[Bug] Unsloth Studio: ANSI escape codes render as literal text in the tool output pane #7962

Closed

Description

@LeoBorcherding

Any command that emits colour or cursor control shows its escape codes as visible text instead of styled output. ls --color=always, grep --color, npm, cargo, pytest all do this by default when they think they have a TTY.

studio/frontend/src/components/assistant-ui/tool-fallback.tsx:327 puts the raw result straight into a <pre>:

<pre className="aui-tool-fallback-result-content whitespace-pre-wrap">
  {typeof result === "string" ? result : JSON.stringify(result, null, 2)}
</pre>

Nothing strips or interprets SGR sequences, so \x1b[32m reaches the DOM as text.

Fix is either strip ANSI before render, or parse SGR into spans if coloured output is wanted. Stripping is the smaller change and matches what the pane is for.

Activity

  1. added 2 commits that reference this issue on Aug 6, 2026
    9fe8cfb
    9fa0c4f
  2. changed the title [-][Bug] Studio: ANSI escape codes render as literal text in the tool output pane[/-] [+][Bug] Unsloth Studio: ANSI escape codes render as literal text in the tool output pane[/+] on Aug 6, 2026
  3. added 2 commits that reference this issue on Aug 7, 2026
    bf56b0c
    305a25f
  4. added a commit that references this issue on Aug 8, 2026
    051e71c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions