Skip to content

fix(output): percent-encode unsafe URI path characters in hyperlinks - #23

Merged
fxrdhan merged 1 commit into
mainfrom
feat/upstream-ports-pr23
Aug 21, 2026
Merged

fxrdhan merged 1 commit into
mainfrom
feat/upstream-ports-pr23

Conversation

@fxrdhan

@fxrdhan fxrdhan commented Aug 21, 2026 •

Copy link
Copy Markdown
Owner
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 — lsr already encoded space, ?, #, %, [, ] and \; this ports only the missing delta plus its regression test.

How Has This Been Tested?
  • New unit test hyperlink_start_tag_escapes_uri_path_characters covering all 13 encoded characters in one filename (gated to non-Windows targets, where the Windows escape set intentionally stays narrower)
  • cargo test --lib: 654 passed
  • cargo clippy --all-targets --all-features -- -D warnings: clean
  • cargo fmt --all -- --check: clean

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
fxrdhan force-pushed the feat/upstream-ports-pr23 branch from 48e1be5 to f6a3abb Compare August 21, 2026 14:31
@fxrdhan
fxrdhan merged commit 96e1167 into main Aug 21, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant