Expand description
WSL terminals (P1 of SPEC_REMOTE_TERMINALS_AND_DURABLE_SESSIONS_2026_10_02.md).
A WSL pane is wsl.exe -d <distro> in a ConPTY: no network, no helper, no
durability (the distro’s shell lives as long as its VM, spec §3.3 and §5.5).
Structs§
- WslLaunch
- What
wsl.exeneeds to start a pane’s process in a distro.
Constants§
- FORWARDED_
ENV - Environment variables a WSL shell should see from the Windows side. WSL does
not pass the Windows environment through;
WSLENVlists what crosses. Never the local URL or auth key: those name this machine’s srv, which a shell in the distro has no business calling without the user knowing. - LIST_
CACHE_ 🔒TTL - How long
list_cachedkeeps an answer.
Functions§
- launch
- The
wsl.exearguments for a pane: an interactive login shell, or the pane’s command run by the distro’ssh.cwdis a path inside the distro; empty means the user’s home. - list
- The installed distributions, or none (not Windows, no WSL, or no distro).
- list_
cached list, kept forLIST_CACHE_TTL: for the places Hangar and the editor tree show each time they open, so a slowwsl.execosts at most one wait per half minute. A connection check useslist, so a distro installed a moment ago is found there.- wslenv
WSLENVwithFORWARDED_ENVadded to whatever the user already set, without duplicates.- wslenv_
with WSLENVfor a process in a distro: the terminal variables, the names its caller set (an agentShellcall’senv, or a pane’s configuredcmd:env), andGH_CONFIG_DIRtranslated to a distro path (/p), so an agent’s plain-ghguard holds inside the distro too andghthere cannot act as the user. Never anAGENTMUX_*variable beyond the terminal ones and the agent id: the auth key, the local URL and the jekt key stay on Windows.