feat: add OSC8 hyperlink support for clickable file paths and URLs #7280
+65
−29
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Adds OSC8 hyperlink support to make file paths and URLs clickable in terminals that support it (iTerm2, Ghostty, Kitty, WezTerm, etc.).
Fixes #1168
Fixes #7273
Changes
Linkcomponent to use native<a href>elements which OpenTUI renders as OSC8 hyperlinksFilePathLinkcomponent for file paths that converts them tofile://URLsWhy this fixes wrapped URL issues (#7273)
OSC8 hyperlinks embed the complete URL in an escape sequence that wraps the visible text. Even when the display text wraps across multiple lines, the terminal retains the full URL metadata, so clicking anywhere on the wrapped link opens the complete URL.
Usage
In supported terminals, Shift+click on file paths or URLs to open them. The exact modifier key depends on your terminal's configuration.
Testing
Tested in Ghostty - file paths open in default editor, URLs open in browser.