vitest-dev / vitest-dev/vitest
Add support for OSC 8 hyperlink in output
Nobody has claimed this yet.
- 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:
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
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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