vitest-dev / vitest-dev/vitest

Add support for OSC 8 hyperlink in output

Open
#9,565 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

feat: reporters p2-nice-to-have
Dominant language
TypeScript
Stars
17.1k
Forks
2k
Avg merge
1d 22h
Merged PRs (30d)
94

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start from the output produced by the vitest run entry point and trace where file paths are rendered in terminal output. Review the OSC 8 reference linked in the issue, then verify that emitted file paths are wrapped as hyperlinks and remain usable in terminals such as Ghostty.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cli, testing-qa
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.