Skip to main content

Module wsl_fs

Module wsl_fs 

Source
Expand description

WSL folders in Hangar and the editor, through Windows’ own share for a distro’s files, \\wsl.localhost\<distro>\... (P1 of SPEC_REMOTE_TERMINALS_AND_DURABLE_SESSIONS_2026_10_02.md).

Windows reads and writes those paths with the ordinary file APIs, so the panes need no new transport, only to know when a path is one: the rules about where AgentMux may write are written for Windows paths, and a distro has its own home and system folders, and its /mnt/<letter> is a Windows drive. Everything here is string work on a path, so it is tested on every platform.

Structs§

SharePath
A path inside a distro, as seen through the share.

Constants§

LEGACY_SHARE_HOST 🔒
SHARE_HOST
The share’s host. wsl$ is the older name for the same share.
SYSTEM_DIRS 🔒
A distro’s own system folders: the same list AgentMux protects on a Linux machine, plus /mnt (where WSL mounts the Windows drives and its own helpers), /init (WSL’s own init) and /run. / itself counts.

Functions§

drive_path
The Windows path a distro’s /mnt/<letter>/... is: WSL mounts each drive there, so changing it changes the Windows file, and the Windows rules apply.
in_home
Whether linux is a distro user’s home folder or inside one: the WSL side of the editor’s “only under your home folder” rule for writes.
is_home
Whether linux is a distro user’s home folder: /home/<user> or /root.
is_system_path
Whether linux is, or is inside, one of a distro’s system folders.
share_of
split_share where the share exists, on Windows; None elsewhere, where //wsl.localhost/... is an ordinary path and the Windows rules for it are the only ones. Every rule that treats a share path differently goes through this.
share_path
The share path for linux in distro: \\wsl.localhost\<distro>\a\b.
split_share
The distro and Linux path of a path on the share: \\wsl.localhost\D\..., \\wsl$\D\..., the \\?\UNC\wsl.localhost\D\... form canonicalize returns, or any of those with / separators (the frontend’s form). None for any other path.
strip_unc_prefix 🔒