Conversation
Windows terminals print several path forms the default hints regex cannot match and the opener cannot resolve (rio issue raphamorim#1943): - add Windows-only alternations to DEFAULT_URL_REGEX for drive-letter paths (C:\x\f.txt, C:/x/f.txt), backslash UNC (\\host\share\doc.pdf) and MSYS forward-slash UNC (//host/share/doc.pdf), all requiring a dotted filename segment and supporting spaces/parens in segments - resolve_path_for_opening now converts POSIX-rooted MSYS/WSL text (/x/..., /cygdrive/x/..., /mnt/x/..., //host/share/...) to Windows paths with an existence check, before the cwd-join fallback - multi-letter roots (/tmp) and bare single-letter prose (cd /d flag) are deliberately not converted Fixes raphamorim#1943
abcfy2
force-pushed
the
fix/hints-windows-paths-1943
branch
from
September 20, 2026 13:54
7948d9d to
056ea49
Compare
This branch has not been deployed
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.
Fixes #1943.
Problem
On Windows, clicking a hinted path that is not a scheme URL silently does nothing for the most common native and MSYS spellings:
C:\Users\me\notes.txt,C:/Users/me/notes.txt\\server\share\doc.pdf,//server/share/doc.pdf/c/Users/me/notes.txt,/cygdrive/c/...,/mnt/c/...Two gaps stack: the default hints regex has no branches for the Windows-only forms, and
resolve_path_for_openingtreats POSIX-rooted text as a relative path and joins it onto the OSC 7 cwd.What this PR does
Detection (
rio-backend/src/config/hints.rs):DEFAULT_URL_REGEXis nowcfg-split. The Windows const keeps the shared alternations and adds three Windows-only branches — drive-letter paths (both separators), backslash UNC, and the MSYS forward-slash UNC spelling. All three require a dotted filename segment (mirroring the conservative bare-relative branch) and allow spaces and parentheses inside segments (Program Files (x86)). The non-Windows const is byte-for-byte unchanged.Resolution (
frontends/rioterm/src/hints.rs):resolve_path_for_openinggains acfg(windows)step that converts POSIX-rooted text (/x/...,/cygdrive/x/...,/mnt/x/...,//host/share/...) to a Windows path and accepts it only if it exists, before the existing cwd-join fallback. OSC 8file://hyperlink clicks route through the same resolver, so MSYS-style OSC 8 links benefit too.Deliberately not converted: multi-letter roots such as
/tmp(the terminal cannot know which POSIX root they map to) and a bare single-letter/x(cd /dflag is ambiguous prose;ls /d/with a trailing slash still converts).Behavior matrix
C:\x\f.txt,C:/x/f.txt,\\srv\sh\d.pdf,//srv/sh/d.pdf/c/...,/cygdrive/c/...,/mnt/c/...README.md,./x)Testing
posix_to_windowsdecision table (single/multi-letter roots, explicit mount syntax, UNC, double separators, bare-flag rejection)Program Files (x86), plus prose rejections:option C: drive, versions/timestamps)DEFAULT_URL_REGEXunchanged; existing suites pass (rio-backend25/25 hints,rioterm18/18 hints on Windows)