Skip to content

Add support for OSC 8 hyperlink in output #9565

@matthieusieben

Description

@matthieusieben

Clear and concise description of the problem

When running vitest from Ghostty, file path in the output are not CMD+clickable:

Image

This is due to the fact that terminals implement some logic to try and match file paths using a regexp, which is an imperfect process.

Terminal emulators and terminal CLI commands have started converging on the OSC 8 "standard" to tag hyperlinks in terminal output, but vitest does not use that standard.

Suggested solution

Wrap file paths in the terminal output with the required tags to mark them as hyperlinks.

Alternative

The https://github.com/sentriz/add-osc-8-hyperlink tool can be used to transform a process's output and add clickable links, but it does not seem to work with the output of vitest run.

Additional context

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    feat: reportersIssues and PRs related to Vitest reportersp2-nice-to-haveNot breaking anything but nice to have (priority)

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions