Add clickable hyperlinks when URLs are on screen
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 14.6k
- Forks
- 734
- Avg merge
- 8h 40m
- Merged PRs (30d)
- 4
Description
I noticed that in some terminals like Gnome, printed URLs become clickable from within the GUI. I know that you can use the following with an OSC sequence to make a clickable URL:
printf '\e]8;;http://example.com\e\\This is a link\e]8;;\e\\\n'
When this is split across multiple lines, more sequences can be attached. That "This is a link" text could very easily be replaced with the URL itself again to act as [http://example.com](http://example.com) does in markdown.
Somewhere in TextBuffer::render, you could leverage the searching functionality you already have to compare against some URL regex found online (see here) and then inject this additional OSC sequence to be printed to the TTY.
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 in TextBuffer::render and inspect the existing searching functionality. Review the OSC hyperlink example and the linked URL-regex reference, then determine how URLs spanning rendered lines should be handled. Done means URLs shown in the terminal are wrapped with OSC hyperlink sequences while preserving the displayed URL text.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100