Skip to content

Open scheme-less OSC 8 file links - #729

Merged
dakra merged 2 commits into
dakra:mainfrom
emil-e:fix/schemeless-osc8-file-links
Oct 12, 2026
Merged

dakra merged 2 commits into
dakra:mainfrom
emil-e:fix/schemeless-osc8-file-links

Conversation

@emil-e

@emil-e emil-e commented Oct 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

Pi can emit Markdown OSC 8 hyperlinks whose targets are relative file paths. Ghostel renders these as clickable links, but the opener silently ignores them because they have no URI scheme.

Resolve existing scheme-less file targets against the terminal buffer's default-directory and open them in another window. Decode percent-encoded paths while rejecting NUL bytes; leave existing scheme dispatch unchanged.

Add dispatcher regression coverage for relative and absolute paths, percent-encoded UTF-8 names, and ignored targets.

Verification

  • All 50 non-native link tests pass.
  • Targeted byte-compilation passes with warnings treated as errors.
  • git diff --check passes.
  • Reproduced the failure on an existing relative-path OSC 8 target in the live antitone buffer and verified the updated dispatcher resolves it to the correct absolute path.

emil-e and others added 2 commits October 12, 2026 08:45
A bare path[:LINE[:COL]] target reuses the fileref: parser and opens at
its position.  An absolute one keeps the TRAMP prefix of a remote
default-directory instead of resolving locally, and Windows MSYS and
Cygwin spellings are rewritten as for file:// URIs.

Any URI scheme, not only scheme://, is handed to browse-url, so mailto:
links work.  NAME:LINE[:COL] and Windows drive letters are not schemes.
@dakra
dakra force-pushed the fix/schemeless-osc8-file-links branch from 856dea3 to bddb7d1 Compare October 12, 2026 06:45
@dakra
dakra merged commit bddb7d1 into dakra:main Oct 12, 2026
24 checks passed

This branch was previously deployed

1 inactive deployment
github-pages — bddb7d14 Deployed Oct 12, 2026 by dakra via deploy #211
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.

2 participants