pytest-dev / pytest-dev/pytest
Support OSC 8 hyperlinks
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 14.5k
- Forks
- 3.4k
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 35
Description
What's the problem this feature will solve?
Being able to quickly open any file mentioned when a test fails or crashes.
Describe the solution you'd like
Terminal emulators now have hyperlinks! 🎉🎉🎉
It's supported by most terminal emulators, as well as application like ls and less:
https://github.com/Alhadis/OSC8-Adoption/
pytest should have a new --hyperlinks command line option, similar to the one that ls now has.
All paths in pytest's output should be links when this option is turned on (which it should be by default, IMO. Terminal emulators that don't support hyperlinks fail gracefully (the escape sequences and the target URL are simply ignored)).
Then you can configure your terminal emulator / tmux to open the link in your favorite text editor / IDE.
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 by locating pytest's command-line option handling and the code that formats paths in test output. Check the existing output-related tests, then verify that --hyperlinks makes all reported paths terminal hyperlinks while preserving normal output when the option is absent.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli, testing
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100