fix(output): percent-encode unsafe URI path characters in hyperlinks - #23
Merged
Merged
Conversation
Filenames containing characters that are unsafe in an OSC 8 file:// URI path — double quotes, angle brackets, carets, backticks, and curly braces/pipe — were embedded raw into the hyperlink target, producing links that terminals may misinterpret. Extend the escape set so the target stays a valid URI path for any filename.
fxrdhan
force-pushed
the
feat/upstream-ports-pr23
branch
from
August 21, 2026 14:31
48e1be5 to
f6a3abb
Compare
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.
Description
Extends the OSC 8 hyperlink escape set with the remaining characters that are unsafe in a
file://URI path: double quote, angle brackets, caret, backtick, and curly braces/pipe. Previously filenames containing these were embedded raw into the link target, which terminals may misinterpret.Upstream reference: eza-community/eza#1916. This completes the partial port that landed in #3 —
lsralready encoded space,?,#,%,[,]and\; this ports only the missing delta plus its regression test.How Has This Been Tested?
hyperlink_start_tag_escapes_uri_path_characterscovering all 13 encoded characters in one filename (gated to non-Windows targets, where the Windows escape set intentionally stays narrower)cargo test --lib: 654 passedcargo clippy --all-targets --all-features -- -D warnings: cleancargo fmt --all -- --check: clean