fix: correct hyperlink click pipeline on Windows#1471
Open
ZoOtMcNoOt wants to merge 3 commits intoraphamorim:mainfrom
Open
fix: correct hyperlink click pipeline on Windows#1471ZoOtMcNoOt wants to merge 3 commits intoraphamorim:mainfrom
ZoOtMcNoOt wants to merge 3 commits intoraphamorim:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes Windows hyperlink click handling by aligning regex byte offsets with terminal grid columns (for non-ASCII text), using a platform-aware URL opener for OSC 8 hyperlinks, and preventing hyperlink clicks from firing twice.
Changes:
- Export
default_url_command()from backend hints config and reuse it for OSC 8 hyperlink hint actions. - Convert regex match byte offsets to grid column indices via
build_byte_to_col()to avoid URL truncation when non-ASCII precedes the URL. - Clear
highlighted_hintafter successfully triggering a hyperlink click to prevent press/release double-fire; adds a regression test.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| rio-backend/src/config/hints.rs | Exposes default_url_command() so frontends can use the same platform-aware URL open command. |
| frontends/rioterm/src/screen/mod.rs | Fixes byte-offset→column mapping for regex hint matching; uses default_url_command() for OSC 8 dummy hint config; adds clear_highlighted_hint() and a regression test. |
| frontends/rioterm/src/application.rs | Clears highlighted hint after a successful hyperlink trigger to avoid double-execution on mouse release. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
85108b7 to
72170c4
Compare
ddd977a to
a749912
Compare
The test helper start_with_capacity hardcoded bash as the fallback shell, which hangs on Windows CI when spawned through conpty. Use the existing default_shell() which returns powershell on Windows.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Alt+Click on URLs truncates the protocol ("https://..." -> "tps://...")
when non-ASCII characters precede the link on the same line. Additionally,
OSC 8 hyperlinks don't open on Windows, and clicks can double-fire.
Three root causes in the hint/hyperlink click path:
from actual columns when multi-byte chars are present
xdg-openfor OSC 8 hyperlink hints (doesn't exist on Windows)highlighted_hintnot cleared aftertrigger_hyperlink, so bothpress and release handlers fire
Changes:
build_byte_to_col()for correct byte-offset-to-column conversiondefault_url_command()(platform-aware) instead ofxdg-opendefault_url_commandaspubfor cross-crate useFixes #1457