Fix Windows hyperlinks for paths with spaces#1872
Merged
tmccombs merged 5 commits intosharkdp:masterfrom Jan 16, 2026
Merged
Conversation
Fixes sharkdp#1843 Changed the host() function for Windows to return '/' instead of '' to generate RFC 3986 compliant file URLs with three slashes. Before: file://C:/test/hi%20there.txt (broken) After: file:///C:/test/hi%20there.txt (works) This fixes hyperlinks failing on Windows when file paths contain spaces or other characters that require percent-encoding.
tmccombs
requested changes
Jan 15, 2026
Collaborator
tmccombs
left a comment
There was a problem hiding this comment.
It looks like some tests are failing. Probably the tests for hyperlinks need to be updated.
Contributor
Author
checking it immediately |
Contributor
Author
|
Thanks for the heads-up @tmccombs updated the hyperlink test and pushed. CI ran successfully now. |
tmccombs
approved these changes
Jan 16, 2026
Collaborator
tmccombs
left a comment
There was a problem hiding this comment.
We should probably also add an entry to the changelog as well (sorry, I should have mentioned that in my previous review), but looks good.
Collaborator
|
Thanks for fixing this! |
Contributor
Author
Good call @tmccombs I’ll add a changelog entry and push an update shortly. Thanks |
tmccombs
approved these changes
Jan 16, 2026
tmeijn
pushed a commit
to tmeijn/dotfiles
that referenced
this pull request
Mar 24, 2026
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [sharkdp/fd](https://github.com/sharkdp/fd) | minor | `v10.3.0` → `v10.4.2` | MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot). **Proposed changes to behavior should be submitted there as MRs.** --- ### Release Notes <details> <summary>sharkdp/fd (sharkdp/fd)</summary> ### [`v10.4.2`](https://github.com/sharkdp/fd/releases/tag/v10.4.2) [Compare Source](sharkdp/fd@v10.4.1...v10.4.2) #### Bugfixes - Fixed performance regression due to `--ignore-contain`; see [#​1913](sharkdp/fd#1913) and [#​1914](sharkdp/fd#1914) ### [`v10.4.1`](https://github.com/sharkdp/fd/releases/tag/v10.4.1) [Compare Source](sharkdp/fd@v10.4.0...v10.4.1) This is just a re-release of 10.4.0 due to an issue with the 10.4.0 release. ### [`v10.4.0`](https://github.com/sharkdp/fd/releases/tag/v10.4.0) [Compare Source](sharkdp/fd@v10.3.0...v10.4.0) #### Features - Add `--ignore-contain` option to ignore directories containing a named entry (e.g. to ignore [`CACHEDIR.TAG`](https://bford.info/cachedir/)); see [#​1727](sharkdp/fd#1727) ([@​fischman](https://github.com/fischman)). #### Bugfixes - Fix Windows hyperlink generation for paths with spaces. ([#​1872](sharkdp/fd#1872)) - `--print0` combined with `--exec` will now print a `\0` between the output of each entry. Note that if there are multiple instances of `--exec`, the `\0` will be between each *set* of commands, *not* between each individual command run. Fixes [#​1797](sharkdp/fd#1797). - Several bugs were fixed by an update to the `ignore` library used for handling ignore rules - [#​1506](sharkdp/fd#1506) - [#​1667](sharkdp/fd#1667) - [#​1813](sharkdp/fd#1813) #### Changes - Minimum required rust version has been increased to 1.90.0. Notably, this means dropping fully support for intel Mac and Windows 7. - Statically link the CRT for MSVC builds via Cargo config to avoid runtime DLL dependencies, see [#​1874](sharkdp/fd#1874) ([@​FidelSch](https://github.com/FidelSch)) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My42MS43IiwidXBkYXRlZEluVmVyIjoiNDMuNjEuNyIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90IiwiYXV0b21hdGlvbjpib3QtYXV0aG9yZWQiLCJkZXBlbmRlbmN5LXR5cGU6Om1pbm9yIl19-->
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 #1843
This PR fixes hyperlink generation on Windows when file paths contain spaces or other characters that require percent-encoding.
Problem
On Windows, fd was generating file URLs like
file://C:/test/hi%20there.txt(2 slashes) which don't work in Windows Terminal. Paths without spaces worked fine, but paths with spaces failed to open.Solution
Changed the
host()function for Windows to return"/"instead of"", generating RFC 3986 compliant URLs with three slashes:file:///C:/test/hi%20there.txtChanges
src/hyperlink.rsline 61 to return"/"for Windowsfile:///+ drive pathTesting
The fix addresses the exact issue reported:
file://C:/test/hi%20there.txt❌ (broken)file:///C:/test/hi%20there.txt✅ (works)Contribution by Gittensor, see my contribution statistics at https://gittensor.io/miners/details?githubId=105917501