Skip to content

ANSI support in testRun.appendOutput is inconsistent #305615

Closed

Description

@sheremet-va

Does this issue occur when all extensions are disabled?: Yes/No

  • Version: 1.113.0 (Universal)
  • Commit: cfbea10
  • Date: 2026-03-24T15:07:18+01:00
  • Electron: 39.8.3
  • ElectronBuildId: 13620978
  • Chromium: 142.0.7444.265
  • Node.js: 22.22.1
  • V8: 14.2.231.22-electron.0
  • OS: Darwin arm64 25.3.0

From the docs on appendOutput:

Appends raw output from the test runner. On the user's request, the output will be displayed in a terminal. ANSI escape sequences, such as colors and text styles, are supported. New lines must be given as CRLF (\r\n) rather than LF (\n).

However, while it's true the "Test Results" (terminal) output supports ANSI colors, the inline logs (that appear if location is provided) do not support it. If it cannot support it, I would expect vscode to at least strip them or provide a way for us to strip them depending on the context.

Steps to Reproduce:

const testController = vscode.tests.createTestController('vitest')
const request = new vscode.TestRunRequest()
const testRun = testController.createTestRun(request)
testRun.appendOutput('�[33m123�[39m', new vscode.Location(vscode.Uri.file('/usr/me/test/basic.test.js', new vscode.Position(1, 1))))

You can also test it in https://github.com/vitest-dev/vscode

pnpm install
pnpm build
# click on "Run Debug"
# chose "Run Basic v4 Example" (second option)
# add a log, run the test
Image

Activity

  1. added
    bug
    testing
    on Mar 27, 2026
  2. added a commit that references this issue on Apr 7, 2026
    0df461e
  3. added this to the 1.116.0 milestone on Apr 7, 2026
  4. added
    unreleased
    insiders-released
    and removed
    unreleased
    on Apr 7, 2026
  5. locked and limited conversation to collaborators on May 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

buginsiders-releasedtestingverified

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions