microsoft / microsoft/terminal
Improve `file://` hyperlinks support - local/remote hostname
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 105k
- Forks
- 9.6k
- Avg merge
- 3d 17h
- Merged PRs (30d)
- 29
Description
Description of the new feature/enhancement
Currently, Windows Terminal supports the following file:// URI patterns:
file:///C:/SomeDir/SomeFile.txtfile://localhost/C:/SomeDir/SomeFile.txt
The following patterns are rejected with a "This link type is currently not supported" message:
file://wsl$/Ubuntu/SomeDir/SomeFile.txtfile://remote_host/SomeDir/SomeFile.txtfile://local_hostname/SomeDir/SomeFile.txt
Please add support for these cases. Note that the hyperlinks (OSC 8) spec requests for the hostname to be present in file URIs.
Proposed technical implementation details
The following justification is provided in the code:
After testing with ShellExecuteEx (more precisely with Process.Start with UseShellExecute in .NET), I noticed the following:
- Remote hostnames (including
wsl$) are supported just fine by the shell - The local hostname results in the following error: "The system cannot find the file specified"
Therefore, I think the Windows Terminal should:
- Substitute the hostname in the URI with
localhostif it happens to match the local hostname - Maybe also support the FQDN?
- Try to open URIs with a remote hostname as-is
This relates to #7699 and #5001.
See also the discussion in https://github.com/BurntSushi/ripgrep/issues/665 for the problems this feature would solve.
Another example of a really useful usage this would enable would be oh-my-posh WSL links:

Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the linked hostname-handling code in src/cascadia/TerminalApp/TerminalPage.cpp around lines 2304-2309, then trace how file:// hyperlinks are opened. Compare local, remote, localhost, and wsl$ hostnames with ShellExecuteEx behavior. Done means the listed local and remote URI patterns are accepted, with local-hostname handling aligned to the issue's proposal.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- cli, operating-systems
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100