Expand description
Windows ↔ WSL2 path translation bridge.
Provides bidirectional path translation between Windows and WSL2 path formats, handling drive letters, UNC paths, Unicode, and spaces.
§Path Translation Rules
Windows → WSL2:
C:\Users\alice→/mnt/c/Users/aliceD:\data\file.txt→/mnt/d/data/file.txt\\wsl$\Ubuntu\home\alice→/home/alice(UNC WSL path)
WSL2 → Windows:
/home/alice→\\wsl$\Ubuntu\home\alice/mnt/c/Users→C:\Users
§Unicode and Spaces
All translations preserve Unicode characters and handle spaces correctly. Round-trip translation produces the original path for supported formats.
Structs§
- Path
Translation - Result of a path translation attempt.
Enums§
- Translation
Direction - Direction of path translation.
Constants§
- DEFAULT_
WSL_ DISTRO - Default WSL distribution name used for WSL2 → Windows translation.
Functions§
- is_
windows_ path - Check if a path looks like a Windows path.
- translate_
path - Translate a path auto-detecting direction.
- windows_
to_ wsl - Translate a Windows-style path to a WSL2 Linux path.
- wsl_
to_ windows - Translate a WSL2 Linux path to a Windows-style path.
- wsl_
to_ windows_ with_ distro - Translate a WSL2 Linux path to a Windows path with a specified distro name.